luci: go.chromium.org/luci/tokenserver/appengine/impl/utils Index | Files | Directories

package utils

import "go.chromium.org/luci/tokenserver/appengine/impl/utils"

Package utils contains a variety of small utility functions used by other tokenserver packages.

Index

Package Files

doc.go fingerprint.go pem.go service_info.go sn.go tags.go zip.go

func DumpPEM Uses

func DumpPEM(data []byte, header string) string

DumpPEM transforms block to pem-encoding.

Reverse of ParsePEM.

func ParsePEM Uses

func ParsePEM(data, header string) ([]byte, error)

ParsePEM takes pem-encoded block and decodes it, checking the header.

func SerializeSN Uses

func SerializeSN(sn *big.Int) ([]byte, error)

SerializeSN converts a certificate serial number to a byte blob.

func ServiceVersion Uses

func ServiceVersion(c context.Context, s signing.Signer) (string, error)

ServiceVersion returns a string that identifies the app and the version.

It is put in some server responses. The function extracts this information from the given signer.

This function almost never returns errors. It can return an error only when called for the first time during the process lifetime. It gets cached after first successful return.

func TokenFingerprint Uses

func TokenFingerprint(tok string) string

TokenFingerprint returns first 16 bytes of SHA256 of the token, as hex.

Token fingerprints can be used to identify tokens without parsing them.

func ValidateTags Uses

func ValidateTags(tags []string) error

ValidateTags returns an error if some tags are malformed.

Tags are "key:value" pairs that can be passed with some RPCs. They end up inside the tokens and/or BigQuery logs.

func ZlibCompress Uses

func ZlibCompress(in []byte) ([]byte, error)

ZlibCompress zips a blob using zlib.

func ZlibDecompress Uses

func ZlibDecompress(in []byte) ([]byte, error)

ZlibDecompress unzips a blob using zlib.

Directories

PathSynopsis
identitysetPackage identityset implements a set-like structure for identity.Identity.
policyPackage policy contains implementation of Policy parsing and querying.
revocationPackage revocation contains utilities for implementing token revocation.
shardsPackage shards provides a low level support for implementing sharded set of []byte blobs.
tokensigningPackage tokensigning implements utilities for RSA-signing of proto messages.

Package utils imports 12 packages (graph) and is imported by 10 packages. Updated 2018-12-12. Refresh now. Tools for package owners.