Class SignatureMetadataParameters
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
,Object> SequencedMap<String,
Object>
HTTP Signature Metadata Parameters.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
"alg"
: Explicitly declared signature algorithm.static final String
"created"
: Timestamp of signature creation.static final String
"expires"
: Timestamp of proposed signature expiration.static final String
"keyid"
: Key identifier for the signing and verification keys used to create this signature.static final String
"nonce"
: A single-use nonce value.static final String
"tag"
: An application-specific tag for a signature. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlg()
Get the value of thealg
parameter.Get the value of thecreated
parameter.Get the value of theexpires
parameter.getKeyid()
Get the value of thekeyid
parameter.getNonce()
Get the value of thenonce
parameter.getTag()
Get the value of thetag
parameter.Serialize the parameters represented by this instance, as defined in RFC 8941 Structured Field Values for HTTP, and return the resulting string.Serialize the parameters represented by this instance, as defined in RFC 8941 Structured Field Values for HTTP, and write the resulting string into the specified string builder.Set the value of thealg
parameter.setCreated
(Long created) Set the value of thecreated
parameter.setCreated
(Instant created) Set the value of thecreated
parameter.setExpires
(Long expires) Set the value of theexpires
parameter.setExpires
(Instant expires) Set the value of theexpires
parameter.Set the value of thekeyid
parameter.Set the value of thenonce
parameter.Set the value of thetag
parameter.toString()
Get the string representation of this instance, which is the serialized parameters returned by theserialize()
method.Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
ALG
-
CREATED
-
EXPIRES
-
KEYID
"keyid"
: Key identifier for the signing and verification keys used to create this signature.- See Also:
-
NONCE
-
TAG
-
-
Constructor Details
-
SignatureMetadataParameters
public SignatureMetadataParameters()The default constructor.
-
-
Method Details
-
getAlg
Get the value of thealg
parameter.- Returns:
- The value of the
alg
parameter. This can be null. - Throws:
IllegalStateException
- The parameter value identified by the key"alg"
is not null, but it is not an instance ofString
.
-
setAlg
Set the value of thealg
parameter.- Parameters:
alg
- The value of thealg
parameter.- Returns:
this
object.
-
getCreated
Get the value of thecreated
parameter.- Returns:
- The value of the
created
parameter. This can be null. - Throws:
IllegalStateException
- The parameter value identified by the key"created"
is not null, but it is neither aLong
instance nor anInteger
instance. Or the number represented by the value is outside the valid range for 'seconds since the Unix epoch'.
-
setCreated
Set the value of thecreated
parameter.- Parameters:
created
- The value of thecreated
parameter.- Returns:
this
object.
-
setCreated
Set the value of thecreated
parameter.- Parameters:
created
- The value of thecreated
parameter.- Returns:
this
object.
-
getExpires
Get the value of theexpires
parameter.- Returns:
- The value of the
expires
parameter. This can be null. - Throws:
IllegalStateException
- The parameter value identified by the key"expires"
is not null, but it is neither aLong
instance nor anInteger
instance. Or the number represented by the value is outside the valid range for 'seconds since the Unix epoch'.
-
setExpires
Set the value of theexpires
parameter.- Parameters:
expires
- The value of theexpires
parameter.- Returns:
this
object.
-
setExpires
Set the value of theexpires
parameter.- Parameters:
expires
- The value of theexpires
parameter.- Returns:
this
object.
-
getKeyid
Get the value of thekeyid
parameter.- Returns:
- The value of the
keyid
parameter. This can be null. - Throws:
IllegalStateException
- The parameter value identified by the key"keyid"
is not null, but it is not an instance ofString
.
-
setKeyid
Set the value of thekeyid
parameter.- Parameters:
keyid
- The value of thekeyid
parameter.- Returns:
this
object.
-
getNonce
Get the value of thenonce
parameter.- Returns:
- The value of the
nonce
parameter. This can be null. - Throws:
IllegalStateException
- The parameter value identified by the key"nonce"
is not null, but it is not an instance ofString
.
-
setNonce
Set the value of thenonce
parameter.- Parameters:
nonce
- The value of thenonce
parameter.- Returns:
this
object.
-
getTag
Get the value of thetag
parameter.- Returns:
- The value of the
tag
parameter. This can be null. - Throws:
IllegalStateException
- The parameter value identified by the key"tag"
is not null, but it is not an instance ofString
.
-
setTag
Set the value of thetag
parameter.- Parameters:
tag
- The value of thetag
parameter.- Returns:
this
object.
-
toString
Get the string representation of this instance, which is the serialized parameters returned by theserialize()
method.- Overrides:
toString
in classAbstractMap<String,
Object> - Returns:
- The string representation of this instance.
-
serialize
Serialize the parameters represented by this instance, as defined in RFC 8941 Structured Field Values for HTTP, and return the resulting string.- Returns:
- The serialized parameters represented by this instance.
-
serializeTo
Serialize the parameters represented by this instance, as defined in RFC 8941 Structured Field Values for HTTP, and write the resulting string into the specified string builder.The ABNF for Parameters from RFC 8941 Structured Field Values for HTTP, 3.1.2. Parameters:
parameters = *( ";" *SP parameter ) parameter = param-key [ "=" param-value ] param-key = key key = ( lcalpha / "*" ) *( lcalpha / DIGIT / "_" / "-" / "." / "*" ) lcalpha = %x61-7A ; a-z param-value = bare-item
- Parameters:
sb
- A string builder into which the resulting string is written.- Returns:
- The same string builder that was passed as the argument.
-