Methods
setPublicModulus(modulus)
Set the public modulus.
This is the modulus of the RSA public key. It has to be provided as a raw buffer with no leading zeros.
Parameters:
Name | Type | Description |
---|---|---|
modulus |
Buffer | Public RSA modulus |
- Source:
setSignature(signature)
Set the signature manually.
The signature must be a valid RSA-PSS siganture.
Parameters:
Name | Type | Description |
---|---|---|
signature |
Buffer | RSA signature. |
- Source:
sign(message, privateKey)
Sign the message.
This method will take the provided message and create a signature using the provided RSA private key. The resulting signature is stored in the fulfillment.
The key should be provided as a PEM encoded private key string.
The message is padded using RSA-PSS with SHA256.
Parameters:
Name | Type | Description |
---|---|---|
message |
Buffer | Message to sign. |
privateKey |
String | RSA private key |
- Source:
validate(message) → {Boolean}
Verify the signature of this RSA fulfillment.
The signature of this RSA fulfillment is verified against the provided message and the condition's public modulus.
Parameters:
Name | Type | Description |
---|---|---|
message |
Buffer | Message to verify. |
- Source:
Returns:
Whether this fulfillment is valid.
- Type
- Boolean