Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ErrMsgInvalidSimpleFmt is returned when trying to decode // a simple-format secret that is not simple-encoded ErrMsgInvalidSimpleFmt = "bad format" // ErrMsgCouldNotDecodePEM is returned when trying to decode // a PEM-format secret that is not PEM encoded ErrMsgCouldNotDecodePEM = "could not decode pem block" )
View Source
const ( // ErrMsgEmptyValue is returned when the user attempts // to create a shard with no data provided ErrMsgEmptyValue = "shard can not have empty value" // ErrMsgCouldNotEncrypt is returned when an error occurs // while attempting to encrypt a shard ErrMsgCouldNotEncrypt = "could not encrypt shard value" // ErrMsgCouldNotDecrypt is returned when an error occurs // while attempting to decrypt a shard ErrMsgCouldNotDecrypt = "could not decrypt shard value" // ErrMsgIncorrectDecryptionKey is returned when the user attempts to // decrypt an EncryptedShard with the wrong key (key id mismatch) ErrMsgIncorrectDecryptionKey = "the provided key does not match the shard's encryption key's fingerprint" // ErrMsgCouldNotDecode is returned when a shard value could not // be base64 encoded ErrMsgCouldNotDecode = "could not b64 decode shard value" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedShard ¶
EncryptedShard represents a shard that has been encrypted
func (*EncryptedShard) Decrypt ¶
func (es *EncryptedShard) Decrypt(k *rsa.PrivateKey) (*Shard, error)
Decrypt removes the ASCII armour off a shard and decrypts its value
type Secret ¶
type Secret struct {
Shards []*EncryptedShard
}
Secret represents an encrypted secret
func DecodeSimpleSecret ¶
DecodeSimpleSecret returns a sharded representation of the encrypted secret
func (*Secret) EncodeSimple ¶
EncodeSimple returns a simple string representation of the encrypted secret. This format is KEY_ID(VALUE)
Click to show internal directories.
Click to hide internal directories.