package
0.0.0-20170212075412-5f4467c73283
Repository: https://github.com/pki-io/core.git
Documentation: pkg.go.dev
# Functions
AESDecrypt is an opinionated helper function that decryptes a ciphertext encrypted with 256 bit AES in CBC mode and returns the plaintext.
AESEncrypt is an opinionated helper function that implements 256 bit AES in CBC mode.
Authenticate takes a message and MACs using the given key.
Base64Decode returns the base64 decoded input.
Base64Encode returns the base64 encoding of the input.
Decrypt is a wrapper function that will decrypt a ciphertext using the provided private key, and returns the plaintext.
Encrypt is a wrapper function that will encrypt a plaintext using the provided public key, and returns the ciphertext.
ExpandKey is an opinionated helper function to cryptographically expand a key using a 128 bit salt and PBKDF2.
GenerateECKey is an opinionated helper function to generate a P256 ECDSA key pair.
GenerateRSAKey is an opinionated helper function to generate a 2048 bit RSA key pair.
GetKeyType returns the key type for a given key.
GroupDecrypt takes an Encrypted struct and decrypts for the given private key, returning a plaintext string.
GroupEncrypt takes a plaintext and encrypts with one or more public keys.
HMAC is a wrapper function that calculates a HMAC for a given message and symmetric key.
HMACVerify verifies the HMAC of the given message.
NewSignature returns a new Signed.
Pad takes the src byte array and PKCS5 pads it to blockSize, returning the padded byte array.
PemDecodePrivate decodes a PEM encoded private key.
PemDecodePublic decodes a PEM encoded public key.
PemEncodePrivate PEM encodes a private key.
PemEncodePublic PEM encodes a public key.
RandomBytes generates and returns size number of random bytes.
Sign takes a message string and signs using the given private key.
SignMessage signs a message using the provided private key.
SymmetricDecrypt takes an Encrypted struct and decrypts with the given symmetric key, returning a plaintext string.
SymmetricEncrypt takes a plaintext and symmetrically encrypts using the given key.
TimeOrderedUUID taken directly from https://github.com/mitchellh/packer/blob/master/common/uuid/uuid.go.
UnPad takes the src byte array and PKCS5 unpads it.
UUID is an opinionated helper function that generate a 128 bit time-ordered UUID string.
Verify takes a Signed struct and verifies the signature using the given key.
VerifySignature verifies a message for a given signature and public key.
# Constants
Key types.
Key types.
Signature modes.
Signature modes.
Signature modes.