Versions in this module Expand all Collapse all v0 v0.1.0 Jun 15, 2015 Changes in this version + var ErrInvalidJSONContent = errors.New("invalid json content") + var ErrInvalidSignContent = errors.New("invalid sign content") + var ErrKeyFileDoesNotExist = errors.New("key file does not exist") + var ErrMissingSignatureKey = errors.New("missing signature key") + func AddKeySetFile(filename string, key PublicKey) error + func GenerateCACert(signer PrivateKey, trustedKey PublicKey) (*x509.Certificate, error) + func GenerateCACertPool(signer PrivateKey, trustedKeys []PublicKey) (*x509.CertPool, error) + func GenerateSelfSignedClientCert(key PrivateKey) (*x509.Certificate, error) + func GenerateSelfSignedServerCert(key PrivateKey, domains []string, ipAddresses []net.IP) (*x509.Certificate, error) + func LoadCertificateBundle(filename string) ([]*x509.Certificate, error) + func LoadCertificatePool(filename string) (*x509.CertPool, error) + func NewCertAuthTLSConfig(caPath, certPath, keyPath string) (*tls.Config, error) + func NewIdentityAuthTLSClientConfig(dockerUrl string, trustUnknownHosts bool, rootConfigPath string, ...) (*tls.Config, error) + func NewIdentityAuthTLSConfig(trustKey PrivateKey, clients *ClientKeyManager, addr string, domain string) (*tls.Config, error) + func SaveKey(filename string, key PrivateKey) error + func SavePublicKey(filename string, key PublicKey) error + type ClientKeyManager struct + func NewClientKeyManager(trustKey PrivateKey, clientFile, clientDir string) (*ClientKeyManager, error) + func (c *ClientKeyManager) RegisterTLSConfig(tlsConfig *tls.Config) error + type JSONSignature struct + func NewJSONSignature(content []byte, signatures ...[]byte) (*JSONSignature, error) + func NewJSONSignatureFromMap(content interface{}) (*JSONSignature, error) + func ParseJWS(content []byte) (*JSONSignature, error) + func ParsePrettySignature(content []byte, signatureKey string) (*JSONSignature, error) + func (js *JSONSignature) JWS() ([]byte, error) + func (js *JSONSignature) Merge(others ...*JSONSignature) error + func (js *JSONSignature) Payload() ([]byte, error) + func (js *JSONSignature) PrettySignature(signatureKey string) ([]byte, error) + func (js *JSONSignature) Sign(key PrivateKey) error + func (js *JSONSignature) SignWithChain(key PrivateKey, chain []*x509.Certificate) error + func (js *JSONSignature) Signatures() ([][]byte, error) + func (js *JSONSignature) Verify() ([]PublicKey, error) + func (js *JSONSignature) VerifyChains(ca *x509.CertPool) ([][]*x509.Certificate, error) + type PrivateKey interface + CryptoPrivateKey func() crypto.PrivateKey + PublicKey func() PublicKey + Sign func(data io.Reader, hashID crypto.Hash) (signature []byte, alg string, err error) + func FromCryptoPrivateKey(cryptoPrivateKey crypto.PrivateKey) (PrivateKey, error) + func GenerateECP256PrivateKey() (PrivateKey, error) + func GenerateECP384PrivateKey() (PrivateKey, error) + func GenerateECP521PrivateKey() (PrivateKey, error) + func GenerateRSA2048PrivateKey() (PrivateKey, error) + func GenerateRSA3072PrivateKey() (PrivateKey, error) + func GenerateRSA4096PrivateKey() (PrivateKey, error) + func LoadKeyFile(filename string) (PrivateKey, error) + func LoadOrCreateTrustKey(trustKeyPath string) (PrivateKey, error) + func UnmarshalPrivateKeyJWK(data []byte) (PrivateKey, error) + func UnmarshalPrivateKeyPEM(data []byte) (PrivateKey, error) + type PublicKey interface + AddExtendedField func(string, interface{}) + CryptoPublicKey func() crypto.PublicKey + GetExtendedField func(string) interface{} + KeyID func() string + KeyType func() string + MarshalJSON func() ([]byte, error) + PEMBlock func() (*pem.Block, error) + String func() string + Verify func(data io.Reader, alg string, signature []byte) error + func FilterByHosts(keys []PublicKey, host string, includeEmpty bool) ([]PublicKey, error) + func FromCryptoPublicKey(cryptoPublicKey crypto.PublicKey) (PublicKey, error) + func LoadKeySetFile(filename string) ([]PublicKey, error) + func LoadPublicKeyFile(filename string) (PublicKey, error) + func UnmarshalPublicKeyJWK(data []byte) (PublicKey, error) + func UnmarshalPublicKeyJWKSet(data []byte) ([]PublicKey, error) + func UnmarshalPublicKeyPEM(data []byte) (PublicKey, error) + func UnmarshalPublicKeyPEMBundle(data []byte) ([]PublicKey, error)