Package es.gob.jmulticard.asn1.der.pkcs1
Class DigestInfo
java.lang.Object
es.gob.jmulticard.asn1.DecoderObject
es.gob.jmulticard.asn1.der.Sequence
es.gob.jmulticard.asn1.der.pkcs1.DigestInfo
Tipo ASN.1 PKCS#1 DigestInfo.
DigestInfo::=SEQUENCE { digestAlgorithm AlgorithmIdentifier, digest OCTET STRING }
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
encode
(String signingAlgorithm, byte[] data, CryptoHelper cryptoHelper) Codifica una estructuraDigestInfo
.private static CryptoHelper.DigestAlgorithm
getDigestAlgorithm
(String signatureAlgorithm) Obtiene el algoritmo de huella digital correspondiente a un algoritmo de firma concreto.private static String
getNormalizedSigningAlgorithm
(String algorithm) Normaliza los nombres de algorimo de firma.protected static byte[]
protected static byte[]
protected static byte[]
protected static byte[]
private static byte[]
selectHeaderTemplate
(CryptoHelper.DigestAlgorithm algorithm) Selecciona una plantilla con la cabecera delDigestInfo
para un algoritmo concreto.toString()
Methods inherited from class es.gob.jmulticard.asn1.der.Sequence
decodeValue, getDefaultTag, getElementAt, getElementCount
Methods inherited from class es.gob.jmulticard.asn1.DecoderObject
checkTag, getBytes, getRawDerValue, setDerValue
-
Field Details
-
SHA1WITHRSA_NORMALIZED_ALGO_NAME
- See Also:
-
SHA256WITHRSA_NORMALIZED_ALGO_NAME
- See Also:
-
SHA384WITHRSA_NORMALIZED_ALGO_NAME
- See Also:
-
SHA512WITHRSA_NORMALIZED_ALGO_NAME
- See Also:
-
SHA1_DIGESTINFO_HEADER
private static final byte[] SHA1_DIGESTINFO_HEADER -
SHA256_DIGESTINFO_HEADER
private static final byte[] SHA256_DIGESTINFO_HEADER -
SHA384_DIGESTINFO_HEADER
private static final byte[] SHA384_DIGESTINFO_HEADER -
SHA512_DIGESTINFO_HEADER
private static final byte[] SHA512_DIGESTINFO_HEADER
-
-
Constructor Details
-
DigestInfo
public DigestInfo()Construye un objeto ASN.1 PKCS#1 DigestInfo.
-
-
Method Details
-
getSha1DigestinfoHeader
protected static byte[] getSha1DigestinfoHeader()- Returns:
- the sha1DigestinfoHeader
-
getSha256DigestinfoHeader
protected static byte[] getSha256DigestinfoHeader()- Returns:
- the sha256DigestinfoHeader
-
getSha384DigestinfoHeader
protected static byte[] getSha384DigestinfoHeader()- Returns:
- the sha384DigestinfoHeader
-
getSha512DigestinfoHeader
protected static byte[] getSha512DigestinfoHeader()- Returns:
- the sha512DigestinfoHeader
-
toString
-
encode
public static byte[] encode(String signingAlgorithm, byte[] data, CryptoHelper cryptoHelper) throws IOException Codifica una estructuraDigestInfo
.- Parameters:
signingAlgorithm
- Algoritmo de huella digital o de firma electrónica.data
- Datos de los que obtener la estructura.cryptoHelper
- Manejador de operaciones criptográficas.- Returns:
- Estructura
DigestInfo
. - Throws:
IOException
- Cuando se produce algun error en la estrucura de la estructura.
-
getNormalizedSigningAlgorithm
Normaliza los nombres de algorimo de firma.- Parameters:
algorithm
- Nombre de algoritmo.- Returns:
- Nombre de algoritmo normalizado.
-
selectHeaderTemplate
Selecciona una plantilla con la cabecera delDigestInfo
para un algoritmo concreto.- Parameters:
algorithm
- Algoritmo del que obtener la plantilla de cabecera.- Returns:
- Cabecera.
-
getDigestAlgorithm
Obtiene el algoritmo de huella digital correspondiente a un algoritmo de firma concreto.- Parameters:
signatureAlgorithm
- Algoritmo de firma.- Returns:
- Algoritmo de huella digital o la propia entrada si no se identificó.
-