diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-05-17 13:57:03 +0200 |
---|---|---|
committer | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-05-17 13:57:03 +0200 |
commit | 74d19c0493d7bf464d466b2dff2305021d911c27 (patch) | |
tree | 8ba8fe9fd1cd0dd7bc03564c5c9f11621e17a2b6 /src/main/java/org/uic/barcode/Decoder.java | |
parent | Delete uicRailTicketData_v1.3.1.asn (diff) | |
download | UIC-barcode-74d19c0493d7bf464d466b2dff2305021d911c27.tar UIC-barcode-74d19c0493d7bf464d466b2dff2305021d911c27.tar.gz UIC-barcode-74d19c0493d7bf464d466b2dff2305021d911c27.tar.bz2 UIC-barcode-74d19c0493d7bf464d466b2dff2305021d911c27.tar.lz UIC-barcode-74d19c0493d7bf464d466b2dff2305021d911c27.tar.xz UIC-barcode-74d19c0493d7bf464d466b2dff2305021d911c27.tar.zst UIC-barcode-74d19c0493d7bf464d466b2dff2305021d911c27.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;
}
/**
|