7.2. Digital Signatures (DS)¶
Data Types:
- DSSignKey
The RSA private key for public-key signatures with RSA.
- DSVerifyKey
The RSA public key, used for verifying RSA signatures.
Functions:
-
DSKeyGen
() (DSSignKey, DSVerifyKey, error)¶ Generate a 256-byte (2048-bit) RSA key pair for digital signatures.
- Return type
DSSignKey, DSVerifyKey, error
-
DSSign
(sk DSSignKey, msg []byte) ([]byte, error)¶ Use the RSA private key to create a signature.
- Parameters
sk (DSSignKey) – RSA signing (private) key
msg ([]byte) – Arbitrary-length message to sign
- Return type
[]byte, error
-
DSVerify
(vk DSVerifyKey, msg []byte, sig []byte) (error)¶ Use the RSA public key to verify a signature.
- Parameters
vk (DSVerifyKey) – RSA verification (public) key
msg ([]byte) – Arbitrary-length message to verify
sig ([]byte) – Signature to verify
- Return type
error