diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-05-30 09:28:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 09:28:14 +0200 |
commit | 804b064202a8212bba0a1e2f69b66adc6336c575 (patch) | |
tree | 15610c6226033753cbc77a3d060bd834f85471af /src/main/java/org/uic/barcode/Decoder.java | |
parent | Merge pull request #63 from irrationalism/bugfix/fix-productIdNum-range-v2 (diff) | |
parent | fix on productId in version 1 FCB (diff) | |
download | UIC-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.java | 15 |
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;
}
/**
|