Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashAlgorithm ¶
type HashAlgorithm string
const ( HashAlgorithmSha1 HashAlgorithm = "sha1" HashAlgorithmSha224 HashAlgorithm = "sha2-224" HashAlgorithmSha256 HashAlgorithm = "sha2-256" HashAlgorithmSha384 HashAlgorithm = "sha2-384" HashAlgorithmSha512 HashAlgorithm = "sha2-512" )
type SignatureAlgorithm ¶
type SignatureAlgorithm string
const ( SignatureAlgorithmRSAPSS SignatureAlgorithm = "pss" SignatureAlgorithmRSAPKCS1v15 SignatureAlgorithm = "pkcs1v15" )
type SignerConfig ¶
type SignerConfig struct { // Namespace for the key. This can be provided in the key config, the vault client, // or both where they will be combined Namespace string // Mountpath is the mount path for transit secrets engine that holds the key MountPath string // Keyname is the name of the key in the transit secrets engine KeyName string // Context is the context for a derived key and can only be provided when working // with a derived key Context []byte // HashAlgorithm is the hash algorithm used in the signing operation. It is only supported // for RSA and ECDSA keys. If unset for supported keys, the value will default to sha2-256. // If the sign request hashes the signing data in the request, this value will be ignored. HashAlgorithm HashAlgorithm // SignatureAlgorithm is the signature algorithm used in the signing operation. It is only // support for RSA keys. If unset for supported keys, the value will default to PKCS#1v15. SignatureAlgorithm SignatureAlgorithm }
type VaultSigner ¶
type VaultSigner struct {
// contains filtered or unexported fields
}
func NewVaultSigner ¶
func NewVaultSigner(vaultClient *api.Client, signerConfig *SignerConfig) (*VaultSigner, error)
NewVaultSigner creates a signer the leverages HashiCorp Vault's transit engine to sign using Go's built in crypto.Signer interface.
func (*VaultSigner) CloneWithContext ¶
func (s *VaultSigner) CloneWithContext(context []byte) (*VaultSigner, error)
CloneWithContext copies the signer with a new context. This function will also retrieve the derived public key.
func (*VaultSigner) Public ¶
func (s *VaultSigner) Public() crypto.PublicKey
Public returns the public key for the key stored in transit's secrets engine
func (*VaultSigner) Sign ¶
func (s *VaultSigner) Sign(_ io.Reader, digest []byte, signerOpts crypto.SignerOpts) ([]byte, error)
Sign is part of the crypto.Signer interface and signs a given digest with the configured key in Vault's transit secrets engine
Click to show internal directories.
Click to hide internal directories.