Documentation ¶
Index ¶
- Constants
- func FetchKeyBlock(fileName string) (*pem.Block, error)
- func FetchPrivateKey(keyID KeyID) (*rsa.PrivateKey, error)
- func FetchPrivateKeyECDSA(keyID KeyID) (*ecdsa.PrivateKey, error)
- func FetchPublicKey(keyID KeyID) (*rsa.PublicKey, error)
- func FetchPublicKeyECDSA(keyID KeyID) (*ecdsa.PublicKey, error)
- func SignECDSA(message VerifiableMessage, keyID KeyID, rand io.Reader) error
- func SignPKCS1v15(message VerifiableMessage, keyID KeyID) error
- func SignProto(message VerifiableMessage, key []byte) error
- func ValidateECDSA(message VerifiableMessage, keyID KeyID) (bool, error)
- func ValidateHMAC(message VerifiableMessage, key []byte) (bool, error)
- func ValidatePKCS1v15(message VerifiableMessage, keyID KeyID) (bool, error)
- type KeyID
- type VerifiableMessage
Constants ¶
View Source
const ( HMACSHA256 signatureProtocol = iota RSAPKCS1v15SHA256 ECDSA )
View Source
const DefaultKeysDir = "integrity-keys"
View Source
const ImplicitMessageIntegrityKey = "IMPLICIT_MESSAGE_INTEGRITY_KEY"
View Source
const ImplicitMessageIntegrityPrivateKey = "IMPLICIT_MESSAGE_INTEGRITY_PRIVATE_KEY"
View Source
const ImplicitMessageIntegrityPublicKey = "IMPLICIT_MESSAGE_INTEGRITY_PUBLIC_KEY"
Variables ¶
This section is empty.
Functions ¶
func FetchKeyBlock ¶
Retrieve a pem encoded file.
func FetchPrivateKey ¶
func FetchPrivateKey(keyID KeyID) (*rsa.PrivateKey, error)
Retrieve a pem encode private key from a file.
func FetchPrivateKeyECDSA ¶
func FetchPrivateKeyECDSA(keyID KeyID) (*ecdsa.PrivateKey, error)
Retrieve a pem encode private key from a file.
func FetchPublicKey ¶
Retrieve a pem encode public key from a file.
func FetchPublicKeyECDSA ¶
Retrieve a pem encode public key from a file.
func SignECDSA ¶
func SignECDSA(message VerifiableMessage, keyID KeyID, rand io.Reader) error
SignProto signs a proto that has a proto field Signature.
func SignPKCS1v15 ¶
func SignPKCS1v15(message VerifiableMessage, keyID KeyID) error
SignProto signs a proto that has a proto field Signature.
func SignProto ¶
func SignProto(message VerifiableMessage, key []byte) error
SignProto signs a proto that has a proto field Signature.
func ValidateECDSA ¶
func ValidateECDSA(message VerifiableMessage, keyID KeyID) (bool, error)
func ValidateHMAC ¶
func ValidateHMAC(message VerifiableMessage, key []byte) (bool, error)
Check the signature embedded in the protobuf message is correct for the message by recalculating it using the secret key.
func ValidatePKCS1v15 ¶
func ValidatePKCS1v15(message VerifiableMessage, keyID KeyID) (bool, error)
Types ¶
type VerifiableMessage ¶
VerifiableMessage a proto message that has a Signature field. Using the extension interface pattern so that I can read the Signature.
Click to show internal directories.
Click to hide internal directories.