Documentation ¶
Overview ¶
Package tls contains wrapper functions for creating GRPC credentials. It also implements RSA key parsing.
Package tls contains wrapper functions for creating GRPC credentials. It also implements RSA key parsing
Index ¶
- func ExtractPublicKey(cert *x509.Certificate) (*rsa.PublicKey, error)
- func LoadCertificate(certContents string) (*x509.Certificate, error)
- func LoadRSAPrivateKey(privContents string) (*gorsa.PrivateKey, error)
- func NewCredentialsFromFile(filePath string, nameOverride string) (credentials.TransportCredentials, error)
- func NewCredentialsFromPEM(certificate string, nameOverride string) (credentials.TransportCredentials, error)
- func NewPublicKeyFromFile(filePath string) (*rsa.PublicKey, error)
- func NewPublicKeyFromPEM(certPEMblock []byte) (*rsa.PublicKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPublicKey ¶
func ExtractPublicKey(cert *x509.Certificate) (*rsa.PublicKey, error)
ExtractPublicKey pulls the certificate's public key from the certificate object If the public key is not an rsa key, it returns an error
func LoadCertificate ¶
func LoadCertificate(certContents string) (*x509.Certificate, error)
LoadCertificate takes a pem encoded certificate (ie the contents of a crt file), parses it and outputs an x509 certificate object
func LoadRSAPrivateKey ¶
func LoadRSAPrivateKey(privContents string) (*gorsa.PrivateKey, error)
LoadRSAPrivateKey takes a pem encoded private key (ie the contents of a private key file), parses it and outputs an x509 private key object
func NewCredentialsFromFile ¶
func NewCredentialsFromFile(filePath string, nameOverride string) (credentials.TransportCredentials, error)
NewCredentialsFromFile creates a TransportCredentials object from the contents of a file. Accepts a nameOverride for use in test environments.
func NewCredentialsFromPEM ¶
func NewCredentialsFromPEM(certificate string, nameOverride string) (credentials.TransportCredentials, error)
NewCredentialsFromPEM creates a TransportCredentials object out of a string. Accepts a nameOverride for use in test environments.
func NewPublicKeyFromFile ¶
NewPublicKeyFromFile reads the contents of a file and uses it to create a PublicKey object.
Types ¶
This section is empty.