Documentation ¶
Index ¶
- Constants
- Variables
- func Attenuate(rootKeyID string, secretKey string, caveats map[string]string) (aKeyID string, aSecretKey string, err error)
- func DecodeKeyID(keyID string) (rootKeyID string, caveats map[string]string, err error)
- func DecryptMessage(encryptionKey [32]byte, encryptedField []byte, nonce []byte) (string, error)
- func EncryptMessage(encryptionKey [32]byte, field []byte) (encrypted []byte, nonceString [24]byte, err error)
- type HMACHasher
- type HMACKey
- type Presignable
- type Presigner
- type TimeLimitedSecret
Constants ¶
View Source
const SecretTokenPrefix = "secret-token:"
SecretTokenPrefix all secret keys will be contain
Variables ¶
View Source
var ( // ErrEncryptedFieldTooLarge - the sku was invalid ErrEncryptedFieldTooLarge = errors.New("encrypted field is greater than 4 KB - this must be chunked") )
Functions ¶
func Attenuate ¶
func Attenuate(rootKeyID string, secretKey string, caveats map[string]string) (aKeyID string, aSecretKey string, err error)
Attenuate a root keyID and secretKey usign the provided caveats
func DecodeKeyID ¶
DecodeKeyID into the root keyID and any caveats, which will be null otherwise
func DecryptMessage ¶
DecryptMessage uses SecretBox to decrypt the message
Types ¶
type HMACHasher ¶
type HMACHasher struct {
// contains filtered or unexported fields
}
HMACHasher is an in process signer implementation for HMACKey
func (*HMACHasher) HMACSha384 ¶
func (hmh *HMACHasher) HMACSha384(payload []byte) ([]byte, error)
HMACSha384 hashes using an in process secret
type HMACKey ¶
type HMACKey interface { // HMACSha384 does the appropriate hashing HMACSha384(payload []byte) ([]byte, error) }
HMACKey an interface for hashing to hmac-sha384
func NewHMACHasher ¶
NewHMACHasher creates a new HMACKey for hashing
type Presignable ¶
Presignable duplicates the hmac interface for signing
type Presigner ¶
type Presigner struct {
// contains filtered or unexported fields
}
Presigner returns the same value always
type TimeLimitedSecret ¶
type TimeLimitedSecret struct {
// contains filtered or unexported fields
}
TimeLimitedSecret represents a secret used to derive Time Limited Credentials
func NewTimeLimitedSecret ¶
func NewTimeLimitedSecret(secret []byte) TimeLimitedSecret
NewTimeLimitedSecret - create a new time limited secret structure
Click to show internal directories.
Click to hide internal directories.