Package com.itextpdf.signatures
Class SignatureMechanisms
java.lang.Object
com.itextpdf.signatures.SignatureMechanisms
Class that contains OID mappings to extract a signature algorithm name
from a signature mechanism OID, and conversely, to retrieve the appropriate
signature mechanism OID given a signature algorithm and a digest function.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMaps IDs of signature algorithms with its human-readable name.private static final IBouncyCastleFactory
private static final org.slf4j.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getAlgorithm
(String oid) Gets the algorithm name for a certain id.static String
getMechanism
(String oid, String digest) Get the signing mechanism name for a certain id and digest.static String
getSignatureMechanismOid
(String signatureAlgorithmName, String digestAlgorithmName) Attempt to look up the most specific OID for a given signature-digest combination.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
BOUNCY_CASTLE_FACTORY
-
algorithmNames
Maps IDs of signature algorithms with its human-readable name. -
rsaOidsByDigest
-
dsaOidsByDigest
-
ecdsaOidsByDigest
-
-
Constructor Details
-
SignatureMechanisms
public SignatureMechanisms()
-
-
Method Details
-
getSignatureMechanismOid
public static String getSignatureMechanismOid(String signatureAlgorithmName, String digestAlgorithmName) Attempt to look up the most specific OID for a given signature-digest combination.- Parameters:
signatureAlgorithmName
- the name of the signature algorithmdigestAlgorithmName
- the name of the digest algorithm, if any- Returns:
- an OID string, or
null
if none was found.
-
getAlgorithm
Gets the algorithm name for a certain id.- Parameters:
oid
- an id (for instance "1.2.840.113549.1.1.1")- Returns:
- an algorithm name (for instance "RSA")
-
getMechanism
Get the signing mechanism name for a certain id and digest.- Parameters:
oid
- an id of an algorithmdigest
- digest of an algorithm- Returns:
- name of the mechanism
-