Class SignatureEntry
- Since:
- 1.4
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SignatureEntry(String label, byte[] signature, SignatureMetadata metadata) Constructor with initial property values. -
Method Summary
Modifier and TypeMethodDescriptiongetLabel()Get the label assigned to the signature.Get the signature metadata.byte[]Get the signature.static Map<String, SignatureEntry> scan(SignatureField signatureField, SignatureInputField signatureInputField) Build a list of signature entries from the providedSignatureandSignature-InputHTTP fields.static Map<String, SignatureEntry> scan(SignatureField signatureField, SignatureInputField signatureInputField, String tag) Build a list of signature entries from the providedSignatureandSignature-InputHTTP fields.Set the label assigned to the signature.setMetadata(SignatureMetadata metadata) Set the signature metadata.setSignature(byte[] signature) Set the signature.toString()Get the string representation of this instance in the following format:"label={label}, signature={signature}, metadata={metadata}".
-
Constructor Details
-
SignatureEntry
public SignatureEntry()Default constructor. -
SignatureEntry
Constructor with initial property values.- Parameters:
label- The label assigned to the signature.signature- The signature.metadata- The signature metadata.
-
-
Method Details
-
getLabel
Get the label assigned to the signature.This should be the key of a member in the
SignatureandSignature-InputHTTP fields.- Returns:
- The label.
-
setLabel
Set the label assigned to the signature.This should be the key of a member in the
SignatureandSignature-InputHTTP fields.- Parameters:
label- The label.- Returns:
thisobject.
-
getSignature
public byte[] getSignature()Get the signature.This should be the value of a member in the
SignatureHTTP field.- Returns:
- The signature.
-
setSignature
Set the signature.This should be the value of a member in the
SignatureHTTP field.- Parameters:
signature- The signature.- Returns:
thisobject.
-
getMetadata
Get the signature metadata.This should be the value of a member in the
Signature-InputHTTP field.- Returns:
- The signature metadata.
-
setMetadata
Set the signature metadata.This should be the value of a member in the
Signature-InputHTTP field.- Parameters:
metadata- The signature metadata.- Returns:
thisobject.
-
toString
Get the string representation of this instance in the following format:"label={label}, signature={signature}, metadata={metadata}".If the label is set,
{label}is replaced with its value; otherwise, it is an empty string.If the signature is set,
{signature}is replaced with:{base64-encoded-signature}:; otherwise, it is an empty string.If the signature metadata is set,
{signature}is replaced with the result ofSignatureMetadata.serialize(); otherwise, it is an empty string. -
scan
public static Map<String,SignatureEntry> scan(SignatureField signatureField, SignatureInputField signatureInputField) throws IllegalArgumentException Build a list of signature entries from the providedSignatureandSignature-InputHTTP fields.This method is an alias of
scan(signatureField, signatureInputField, null).- Parameters:
signatureField- ASignatureFieldinstance that represents the value of theSignatureHTTP field.signatureInputField- ASignatureInputFieldinstance that represents the value of theSignature-InputHTTP field.- Returns:
- A map of signature entries, whose keys are signature labels and values are signature entries.
- Throws:
IllegalArgumentException- Input data are invalid.
-
scan
public static Map<String,SignatureEntry> scan(SignatureField signatureField, SignatureInputField signatureInputField, String tag) throws IllegalArgumentException Build a list of signature entries from the providedSignatureandSignature-InputHTTP fields.If both the
signatureFieldand thesignatureInputFieldarenull, this method returnsnull.If either of the
signatureFieldor thesignatureInputFieldisnullbut the other is notnull, this method throws an exception.If both the
signatureFieldand thesignatureInputFieldare non-null, but the number of members in thesignatureInputFielddoes not match the number of members in thesignatureField, this method throws an exception.If the
signatureInputFielddoes not contain a label found in thesignatureField, this method throws an exception.In other cases, that is, if both the
signatureFieldand thesignatureInputFieldare non-null, their numbers of members are equal, and all the labels in thesignatureFieldare present in thesignatureInputField, this method builds a list of signature entries from the contents of thesignatureFieldand thesignatureInputField.- Parameters:
signatureField- ASignatureFieldinstance that represents the value of theSignatureHTTP field.signatureInputField- ASignatureInputFieldinstance that represents the value of theSignature-InputHTTP field.tag- A tag value for filtering. If a non-null value is specified, only signatures with the tag value are included in the result.- Returns:
- A map of signature entries, whose keys are signature labels and values are signature entries.
- Throws:
IllegalArgumentException- Input data are invalid.
-