Documentation ¶
Index ¶
- Variables
- func BytesToPrivateKey(b []byte) (crypto.PublicKey, jose.SignatureAlgorithm, error)
- func DecryptAES(data string, key string) (string, error)
- func DecryptBytesAES(cipherText []byte, key string) ([]byte, error)
- func EncryptAES(data string, key string) (string, error)
- func EncryptBytesAES(plainText []byte, key string) ([]byte, error)
- func GetHashAlgorithm(sigAlgorithm jose.SignatureAlgorithm) (hash.Hash, error)
- func HashString(hash hash.Hash, s string, firstHalf bool) string
- func Sign(object any, signer jose.Signer) (string, error)
- func SignPayload(payload []byte, signer jose.Signer) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPEMDecode = errors.New("PEM decode failed") ErrUnsupportedFormat = errors.New("key is neither in PKCS#1 nor PKCS#8 format") ErrUnsupportedPrivateKey = errors.New("unsupported key type, must be RSA, ECDSA or ED25519 private key") )
View Source
var ErrCipherTextBlockSize = errors.New("ciphertext block size is too short")
View Source
var ErrUnsupportedAlgorithm = errors.New("unsupported signing algorithm")
Functions ¶
func BytesToPrivateKey ¶
func GetHashAlgorithm ¶
func GetHashAlgorithm(sigAlgorithm jose.SignatureAlgorithm) (hash.Hash, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.