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 providedSignature
andSignature-Input
HTTP fields.static Map
<String, SignatureEntry> scan
(SignatureField signatureField, SignatureInputField signatureInputField, String tag) Build a list of signature entries from the providedSignature
andSignature-Input
HTTP 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
Signature
andSignature-Input
HTTP fields.- Returns:
- The label.
-
setLabel
Set the label assigned to the signature.This should be the key of a member in the
Signature
andSignature-Input
HTTP fields.- Parameters:
label
- The label.- Returns:
this
object.
-
getSignature
public byte[] getSignature()Get the signature.This should be the value of a member in the
Signature
HTTP field.- Returns:
- The signature.
-
setSignature
Set the signature.This should be the value of a member in the
Signature
HTTP field.- Parameters:
signature
- The signature.- Returns:
this
object.
-
getMetadata
Get the signature metadata.This should be the value of a member in the
Signature-Input
HTTP field.- Returns:
- The signature metadata.
-
setMetadata
Set the signature metadata.This should be the value of a member in the
Signature-Input
HTTP field.- Parameters:
metadata
- The signature metadata.- Returns:
this
object.
-
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 providedSignature
andSignature-Input
HTTP fields.This method is an alias of
scan
(signatureField, signatureInputField, null)
.- Parameters:
signatureField
- ASignatureField
instance that represents the value of theSignature
HTTP field.signatureInputField
- ASignatureInputField
instance that represents the value of theSignature-Input
HTTP 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 providedSignature
andSignature-Input
HTTP fields.If both the
signatureField
and thesignatureInputField
arenull
, this method returnsnull
.If either of the
signatureField
or thesignatureInputField
isnull
but the other is notnull
, this method throws an exception.If both the
signatureField
and thesignatureInputField
are non-null, but the number of members in thesignatureInputField
does not match the number of members in thesignatureField
, this method throws an exception.If the
signatureInputField
does not contain a label found in thesignatureField
, this method throws an exception.In other cases, that is, if both the
signatureField
and thesignatureInputField
are non-null, their numbers of members are equal, and all the labels in thesignatureField
are present in thesignatureInputField
, this method builds a list of signature entries from the contents of thesignatureField
and thesignatureInputField
.- Parameters:
signatureField
- ASignatureField
instance that represents the value of theSignature
HTTP field.signatureInputField
- ASignatureInputField
instance that represents the value of theSignature-Input
HTTP 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.
-