summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/Decoder.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2023-05-30 09:28:14 +0200
committerGitHub <noreply@github.com>2023-05-30 09:28:14 +0200
commit804b064202a8212bba0a1e2f69b66adc6336c575 (patch)
tree15610c6226033753cbc77a3d060bd834f85471af /src/main/java/org/uic/barcode/Decoder.java
parentMerge pull request #63 from irrationalism/bugfix/fix-productIdNum-range-v2 (diff)
parentfix on productId in version 1 FCB (diff)
downloadUIC-barcode-804b064202a8212bba0a1e2f69b66adc6336c575.tar
UIC-barcode-804b064202a8212bba0a1e2f69b66adc6336c575.tar.gz
UIC-barcode-804b064202a8212bba0a1e2f69b66adc6336c575.tar.bz2
UIC-barcode-804b064202a8212bba0a1e2f69b66adc6336c575.tar.lz
UIC-barcode-804b064202a8212bba0a1e2f69b66adc6336c575.tar.xz
UIC-barcode-804b064202a8212bba0a1e2f69b66adc6336c575.tar.zst
UIC-barcode-804b064202a8212bba0a1e2f69b66adc6336c575.zip
Diffstat (limited to 'src/main/java/org/uic/barcode/Decoder.java')
-rw-r--r--src/main/java/org/uic/barcode/Decoder.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/org/uic/barcode/Decoder.java b/src/main/java/org/uic/barcode/Decoder.java
index 85faa4a..637bbf6 100644
--- a/src/main/java/org/uic/barcode/Decoder.java
+++ b/src/main/java/org/uic/barcode/Decoder.java
@@ -84,15 +84,22 @@ public class Decoder {
* @throws EncodingFormatException the encoding format exception
*/
public int validateLevel1(PublicKey key) throws InvalidKeyException, NoSuchAlgorithmException, SignatureException, IllegalArgumentException, UnsupportedOperationException, IOException, EncodingFormatException {
- if (dynamicFrame != null && dynamicFrame != null) {
+ if (dynamicFrame != null) {
return dynamicFrame.validateLevel1(key) ;
- } else {
- if (staticFrame != null) {
- return Constants.LEVEL1_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
+ } else if (staticFrame != null) {
+ if (staticFrame.verifyByAlgorithmOid(key,null)) {
+ return Constants.LEVEL1_VALIDATION_OK;
+ } else {
+ return Constants.LEVEL1_VALIDATION_FRAUD;
+ }
+ } else if (ssbFrame!= null) {
+ if (ssbFrame.verifyByAlgorithmOid(key,null, null)) {
+ return Constants.LEVEL1_VALIDATION_OK;
} else {
return Constants.LEVEL1_VALIDATION_FRAUD;
}
}
+ return Constants.LEVEL1_VALIDATION_NO_SIGNATURE;
}
/**