Documentation ¶
Index ¶
- func DecodeCertificate(bytes []byte) (*x509.Certificate, error)
- func DecodePrivateKey(bytes []byte) (*rsa.PrivateKey, error)
- func DecodePublicKey(pemBytes []byte) (*rsa.PublicKey, error)
- func ExtractPubKey(cert *x509.Certificate) (*rsa.PublicKey, error)
- func SHA256(in []byte) []byte
- func Sign(privateKey *rsa.PrivateKey, data []byte) (string, error)
- func VerifySignature(pubKey *rsa.PublicKey, sig string, data []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCertificate ¶
func DecodeCertificate(bytes []byte) (*x509.Certificate, error)
DecodeCertificate takes a byte slice, decodes it from the PEM format, converts it to an x509.Certificate object, and returns it. In case an error occurs, it returns the error.
func DecodePrivateKey ¶
func DecodePrivateKey(bytes []byte) (*rsa.PrivateKey, error)
DecodePrivateKey takes a byte slice, decodes it from the PEM format, converts it to an rsa.PrivateKey object, and returns it. In case an error occurs, it returns the error.
func DecodePublicKey ¶
DecodePublicKey takes a byte slice, decodes it from the PEM format, converts it to an rsa.PublicKey
func ExtractPubKey ¶
func ExtractPubKey(cert *x509.Certificate) (*rsa.PublicKey, error)
ExtractPubKey extracts the RSA PublicKey of the given x509.Certificate.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.