Documentation ¶
Index ¶
- func SignEddsa(signable GenericEccSignable, privKey *ec.PrivateKey) error
- func SignRsa(signable GenericRsaSignable, privKey *rsa.PrivateKey) error
- func VerifyEddsa(verifiable GenericEccSignable, pubKey *ec.PublicKey) error
- func VerifyRsa(verifiable GenericRsaSignable, pubKey *rsa.PublicKey) error
- type GenericEccSignable
- type GenericRsaSignable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignEddsa ¶
func SignEddsa(signable GenericEccSignable, privKey *ec.PrivateKey) error
SignEddsa takes a GenericEccSignable object, marshals the data intended to be signed with a nonce.
func SignRsa ¶
func SignRsa(signable GenericRsaSignable, privKey *rsa.PrivateKey) error
SignRsa takes a GenericRsaSignable object, marshals the data intended to be signed. It hashes that data and sets it as the signature of that object
func VerifyEddsa ¶
func VerifyEddsa(verifiable GenericEccSignable, pubKey *ec.PublicKey) error
VerifyEddsa takes the signature from the verifiable message and verifies it on the public key. If
Types ¶
type GenericEccSignable ¶
type GenericEccSignable interface { // GetSig returns the RSA signature. // IF none exists, it creates it, adds it to the object, then returns it. GetEccSig() *messages.ECCSignature // Digest hashes the contents of the message in a repeatable manner // using the provided cryptographic hash. It includes the nonce in the hash Digest(nonce []byte, h hash.Hash) []byte }
Interface for our GenericRsaSignable structure, to be used for protobuffs we want to be able to cryptographically sign using an RSA key
type GenericRsaSignable ¶
type GenericRsaSignable interface { // GetSig returns the RSA signature. // IF none exists, it creates it, adds it to the object, then returns it. GetSig() *messages.RSASignature // Digest hashes the contents of the message in a repeatable manner // using the provided cryptographic hash. It includes the nonce in the hash Digest(nonce []byte, h hash.Hash) []byte }
Interface for our GenericRsaSignable structure, to be used for protobuffs we want to be able to cryptographically sign using an RSA key
Click to show internal directories.
Click to hide internal directories.