Signer is an interface for an opaque private key that can be used for signing operations. For example, an RSA key kept in a hardware module.

See also:

Fields

@:interfacetypeffundynamicsign(_rand:Reader, _digest:Slice<GoUInt8>, _opts:SignerOpts):{_1:Error, _0:Slice<GoUInt8>}

Sign signs digest with the private key, possibly using entropy from rand. For an RSA key, the resulting signature should be either a PKCS #1 v1.5 or PSS signature (as indicated by opts). For an (EC)DSA key, it should be a DER-serialised, ASN.1 signature structure.

Hash implements the SignerOpts interface and, in most cases, one can simply pass in the hash function used as opts. Sign may also attempt to type assert opts to other types in order to obtain algorithm specific values. See the documentation in each package for details.

Note that when a signature of a hash of a larger message is needed, the caller is responsible for hashing the larger message and passing the hash (as digest) and the hash function (as opts) to Sign.

@:interfacetypeffundynamicpublic_():PublicKey

Public returns the public key corresponding to the opaque, private key.

__underlying__():AnyInterface

Allows struct or interfaces to provide back type information.

Returns:

go.AnyInterface