From e5282f2bc884ce69baa0f0f0117bcd9f965b31bc Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Thu, 30 Apr 2020 14:47:13 +0200 Subject: dynamic header update --- src/org/uic/header/DataBlockType.java | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/org/uic/header/DataBlockType.java') diff --git a/src/org/uic/header/DataBlockType.java b/src/org/uic/header/DataBlockType.java index ce4084f..503c203 100644 --- a/src/org/uic/header/DataBlockType.java +++ b/src/org/uic/header/DataBlockType.java @@ -5,9 +5,14 @@ import net.gcdc.asn1.datatypes.CharacterRestriction; import net.gcdc.asn1.datatypes.IntRange; import net.gcdc.asn1.datatypes.RestrictedString; import net.gcdc.asn1.datatypes.Sequence; +import net.gcdc.asn1.uper.UperEncoder; + /** - * The Class DataBlockType. + * The DataBlockType. + * + * Data block ready for signing + * */ @Sequence public class DataBlockType { @@ -78,10 +83,10 @@ public class DataBlockType { * * e.g.: * -- DSA SHA224 2.16.840.1.101.3.4.3.1 - * -- DSA SHA248 2.16.840.1.101.3.4.3.2 - * -- ECC 1.2.840.10045.3.1.7 + * -- DSA SHA248 2.16.840.1.101.3.4.3.2 + * -- ECC 1.2.840.10045.3.1.7 * - * @param signingAlg the new signing algorithm + * @param signingAlgorithm the new signing alg */ public void setSigningAlg(String signingAlgorithm) { this.signingAlg = signingAlgorithm; @@ -106,5 +111,19 @@ public class DataBlockType { } + /** + * Gets the data for signature. + * + * The byte array containing the ASN.1 PER UNALIGNED encoded data of the DataBlock + * + * + * @return the data for signature + */ + public byte[] getDataForSignature() { + return UperEncoder.encode(this); + + } + + } -- cgit v1.2.3