diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2022-04-13 17:57:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-13 17:57:16 +0200 |
commit | 7a5f15e2b958dca771b83594669401be2b84f2b6 (patch) | |
tree | d96492a7b1958f9822cd994c86d0b0a9f3c6c59f /src/main/java/org/uic/barcode/dynamicFrame/v2/Level2DataType.java | |
parent | Merge pull request #45 from UnionInternationalCheminsdeFer/1.3.1 (diff) | |
parent | unit test for fcb version 1 including all elements (diff) | |
download | UIC-barcode-7a5f15e2b958dca771b83594669401be2b84f2b6.tar UIC-barcode-7a5f15e2b958dca771b83594669401be2b84f2b6.tar.gz UIC-barcode-7a5f15e2b958dca771b83594669401be2b84f2b6.tar.bz2 UIC-barcode-7a5f15e2b958dca771b83594669401be2b84f2b6.tar.lz UIC-barcode-7a5f15e2b958dca771b83594669401be2b84f2b6.tar.xz UIC-barcode-7a5f15e2b958dca771b83594669401be2b84f2b6.tar.zst UIC-barcode-7a5f15e2b958dca771b83594669401be2b84f2b6.zip |
Diffstat (limited to 'src/main/java/org/uic/barcode/dynamicFrame/v2/Level2DataType.java')
-rw-r--r-- | src/main/java/org/uic/barcode/dynamicFrame/v2/Level2DataType.java | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/main/java/org/uic/barcode/dynamicFrame/v2/Level2DataType.java b/src/main/java/org/uic/barcode/dynamicFrame/v2/Level2DataType.java index cd0800e..262fa2f 100644 --- a/src/main/java/org/uic/barcode/dynamicFrame/v2/Level2DataType.java +++ b/src/main/java/org/uic/barcode/dynamicFrame/v2/Level2DataType.java @@ -1,15 +1,10 @@ package org.uic.barcode.dynamicFrame.v2;
-import java.security.PrivateKey;
-import java.security.Provider;
-import java.security.Signature;
-
import org.uic.barcode.asn1.datatypes.Asn1Optional;
import org.uic.barcode.asn1.datatypes.FieldOrder;
import org.uic.barcode.asn1.datatypes.Sequence;
import org.uic.barcode.asn1.datatypesimpl.OctetString;
import org.uic.barcode.asn1.uper.UperEncoder;
-import org.uic.barcode.utils.AlgorithmNameResolver;
/**
* The Class DataType.
@@ -76,46 +71,7 @@ public class Level2DataType { return UperEncoder.encode(this);
}
- /**
- * Sign the contained data block.
- *
- * Note: an appropriate security provider (e.g. BC) must be registered before
- *
- * @param key the key
- * @return
- * @return the byte[]
- * @throws Exception
- */
- public void signLevel1(PrivateKey key) throws Exception {
- //find the algorithm name for the signature OID
- String algo = AlgorithmNameResolver.getSignatureAlgorithmName(getLevel1Data().level1SigningAlg);
- Signature sig = Signature.getInstance(algo);
- sig.initSign(key);
- byte[] data = level1Data.encode();
- sig.update(data);
- this.level1Signature = new OctetString(sig.sign());
- }
- /**
- * Sign the contained data block.
- *
- * Note: an appropriate security provider (e.g. BC) must be registered before
- *
- * @param key the key
- * @param security provider - security provider that must be sued to create the signature
- * @return
- * @return the byte[]
- * @throws Exception
- */
- public void signLevel1(PrivateKey key, Provider prov) throws Exception {
- //find the algorithm name for the signature OID
- String algo = AlgorithmNameResolver.getSignatureAlgorithmName(getLevel1Data().level1SigningAlg);
- Signature sig = Signature.getInstance(algo, prov);
- sig.initSign(key);
- byte[] data = level1Data.encode();
- sig.update(data);
- this.level1Signature = new OctetString(sig.sign());
- }
}
|