Class AlgorithmIdentifier
java.lang.Object
zeroecho.pkix.AlgorithmIdentifier
Provider-independent X.509
AlgorithmIdentifier (RFC 5280): an OID with
an exactly-typed parameter form.
This is a canonical value type. It never depends on a concrete cryptographic toolkit; it captures precisely how the algorithm parameters are encoded so that a backend can reproduce the exact DER form:
AlgorithmIdentifier.ParameterForm.ABSENT— noparametersfield is present;AlgorithmIdentifier.ParameterForm.DER_NULL— theparametersfield is DER NULL;AlgorithmIdentifier.ParameterForm.EXACT_DER— theparametersfield is the exact canonical DER carried byparameters().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEncoding form of the optionalparametersfield. -
Method Summary
Modifier and TypeMethodDescriptionstatic AlgorithmIdentifierCreates an identifier with noparametersfield.static AlgorithmIdentifierCreates an identifier whoseparametersfield is DER NULL.booleanstatic AlgorithmIdentifierCreates an identifier whoseparametersfield is exact canonical DER.inthashCode()oid()Returns the dotted-decimal object identifier.Returns the parameter encoding form.byte[]Returns a copy of the exact DER parameters, ornullunless the form isAlgorithmIdentifier.ParameterForm.EXACT_DER.toString()
-
Method Details
-
absent
Creates an identifier with noparametersfield.- Parameters:
oid- dotted-decimal object identifier- Returns:
- identifier with an absent parameter field
-
derNull
Creates an identifier whoseparametersfield is DER NULL.- Parameters:
oid- dotted-decimal object identifier- Returns:
- identifier with a DER NULL parameter field
-
exact
Creates an identifier whoseparametersfield is exact canonical DER.- Parameters:
oid- dotted-decimal object identifierderParameters- exact DER encoding of the parameters field- Returns:
- identifier with an exact-DER parameter field
-
oid
-
parameterForm
Returns the parameter encoding form.- Returns:
- the parameter form
-
parameters
public byte[] parameters()Returns a copy of the exact DER parameters, ornullunless the form isAlgorithmIdentifier.ParameterForm.EXACT_DER.- Returns:
- a defensive copy of the parameter DER, or
null
-
equals
-
hashCode
-
toString
-