Documentation
¶
Index ¶
- func MarshalCertificate(cert *x509.Certificate) []byte
- func MarshalPrivateKey(priv crypto.PrivateKey, passphrase string) ([]byte, error)
- func UnmarshalCertificate(data []byte) (*x509.Certificate, error)
- func UnmarshalPrivateKey(data []byte, passphrase string) (crypto.PrivateKey, error)
- func Verify(cert *x509.Certificate, data []byte, signature []byte) error
- func VerifyMessage(cert *x509.Certificate, msg proto.Message, signature []byte) error
- type Identity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalCertificate ¶
func MarshalCertificate(cert *x509.Certificate) []byte
MarshalCertificate exports the certificate in PEM format.
func MarshalPrivateKey ¶
func MarshalPrivateKey(priv crypto.PrivateKey, passphrase string) ([]byte, error)
MarshalPrivateKey exports the private key in PEM format, optionally encrypted.
func UnmarshalCertificate ¶
func UnmarshalCertificate(data []byte) (*x509.Certificate, error)
UnmarshalCertificate imports a certificate from PEM format.
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(data []byte, passphrase string) (crypto.PrivateKey, error)
UnmarshalPrivateKey imports a private key from PEM format.
func Verify ¶
func Verify(cert *x509.Certificate, data []byte, signature []byte) error
Verify checks a signature against the given data and certificate.
func VerifyMessage ¶
VerifyMessage verifies a protobuf message's signature. It clears the 'auth' field before verifying.
Types ¶
type Identity ¶
type Identity struct {
Certificate *x509.Certificate
PrivateKey crypto.PrivateKey
}
Identity represents the cryptographic identity of an agent.
Click to show internal directories.
Click to hide internal directories.