Documentation
¶
Index ¶
- func ConvertToEcdsaPublicFromJWK(key *jose.JSONWebKey) (*ecdsa.PublicKey, error)
- func ConvertToJSONWebKey(input []byte) (jose.JSONWebKey, error)
- func ConvertToRSAPrivateFromJWK(key *jose.JSONWebKey) (*rsa.PrivateKey, error)
- func ConvertToRSAPublicFromJWK(key *jose.JSONWebKey) (*rsa.PublicKey, error)
- func DecodePrivateKey(bytedata []byte, encryptkey *entity.EncryptKey) error
- func DecodePublicKey(bytedata []byte, encryptkey *entity.EncryptKey) error
- func EncodeEcdsaPrivateKey(prikey *ecdsa.PrivateKey) ([]byte, error)
- func EncodeEcdsaPublicKey(pubkey *ecdsa.PublicKey) ([]byte, error)
- func EncodeRsaPrivateKeyPKCS1(prikey *rsa.PrivateKey) []byte
- func EncodeRsaPrivateKeyPKCS8(prikey *rsa.PrivateKey) ([]byte, error)
- func EncodeRsaPublicKey(pubkey *rsa.PublicKey) ([]byte, error)
- func GenerateHashFromCrptoKey(key interface{}) string
- func GenerateJSONWebKeyWithEcdsaPrivateKey(privatekey *ecdsa.PrivateKey, kid string) ([]byte, error)
- func GenerateJSONWebKeyWithEcdsaPublicKey(publickey *ecdsa.PublicKey, kid string) ([]byte, error)
- func GenerateJSONWebKeyWithRSAPrivateKey(privatekey *rsa.PrivateKey, kid string) ([]byte, error)
- func GenerateJSONWebKeyWithRSAPublicKey(publickey *rsa.PublicKey, kid string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToEcdsaPublicFromJWK ¶ added in v0.1.1
func ConvertToEcdsaPublicFromJWK(key *jose.JSONWebKey) (*ecdsa.PublicKey, error)
ConvertToEcdsaPublicFromJWK convert to ECDSA public key from JWK
func ConvertToJSONWebKey ¶
func ConvertToJSONWebKey(input []byte) (jose.JSONWebKey, error)
ConvertToJSONWebKey convert to JWK
func ConvertToRSAPrivateFromJWK ¶
func ConvertToRSAPrivateFromJWK(key *jose.JSONWebKey) (*rsa.PrivateKey, error)
ConvertToRSAPrivateFromJWK convert to RSA private key from JWK
func ConvertToRSAPublicFromJWK ¶
func ConvertToRSAPublicFromJWK(key *jose.JSONWebKey) (*rsa.PublicKey, error)
ConvertToRSAPublicFromJWK convert to RSA public key from JWK
func DecodePrivateKey ¶ added in v0.1.1
func DecodePrivateKey(bytedata []byte, encryptkey *entity.EncryptKey) error
DecodePrivateKey reads private to entity struct
func DecodePublicKey ¶
func DecodePublicKey(bytedata []byte, encryptkey *entity.EncryptKey) error
DecodePublicKey reads publickey to entity struct
func EncodeEcdsaPrivateKey ¶ added in v0.1.1
func EncodeEcdsaPrivateKey(prikey *ecdsa.PrivateKey) ([]byte, error)
EncodeEcdsaPrivateKey decodes ECDSA private key to bytes
func EncodeEcdsaPublicKey ¶ added in v0.1.1
EncodeEcdsaPublicKey decodes public key to bytes
func EncodeRsaPrivateKeyPKCS1 ¶ added in v0.1.1
func EncodeRsaPrivateKeyPKCS1(prikey *rsa.PrivateKey) []byte
EncodeRsaPrivateKeyPKCS1 decodes PKCS1 private key to bytes
func EncodeRsaPrivateKeyPKCS8 ¶ added in v0.1.1
func EncodeRsaPrivateKeyPKCS8(prikey *rsa.PrivateKey) ([]byte, error)
EncodeRsaPrivateKeyPKCS8 decodes PKCS8 private key to bytes
func EncodeRsaPublicKey ¶ added in v0.1.1
EncodeRsaPublicKey decodes public key to bytes
func GenerateHashFromCrptoKey ¶ added in v0.1.1
func GenerateHashFromCrptoKey(key interface{}) string
GenerateHashFromCrptoKey generates Hash from private / public key
func GenerateJSONWebKeyWithEcdsaPrivateKey ¶ added in v0.1.1
func GenerateJSONWebKeyWithEcdsaPrivateKey(privatekey *ecdsa.PrivateKey, kid string) ([]byte, error)
GenerateJSONWebKeyWithEcdsaPrivateKey convert ecdsa privatekey to JWK
func GenerateJSONWebKeyWithEcdsaPublicKey ¶ added in v0.1.1
GenerateJSONWebKeyWithEcdsaPublicKey convert ecdsa publickey to JWK
func GenerateJSONWebKeyWithRSAPrivateKey ¶
func GenerateJSONWebKeyWithRSAPrivateKey(privatekey *rsa.PrivateKey, kid string) ([]byte, error)
GenerateJSONWebKeyWithRSAPrivateKey convert rsa privatekey to JWK
Types ¶
This section is empty.