-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ARGOeu/revert-4-tl-ts
Revert "ET-29 TL source trust source"
- Loading branch information
Showing
21 changed files
with
0 additions
and
1,174 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,2 @@ | ||
# gr.grnet.eseal | ||
E-signature library | ||
|
||
### PDF Validation using an X509 certificate | ||
|
||
```java | ||
import gr.grnet.eseal.PDFValidator; | ||
import gr.grnet.eseal.ValidationLevel; | ||
import gr.grnet.eseal.ValidationReport; | ||
import gr.grnet.eseal.X509CertificateTrustSource; | ||
|
||
public class Example | ||
{ | ||
public static void main( String[] args ) { | ||
|
||
// Initialise the pdf validator from a file source | ||
PDFValidator pdf = new PDFValidator("/path/to/pdf/file"); | ||
|
||
|
||
try { | ||
|
||
// Initialise the x509 trust source from a file source | ||
X509CertificateTrustSource x509CertificateTrustSource = new X509CertificateTrustSource("/path/to/cert"); | ||
|
||
// Validate the document based on the provided trust source(x509 cert) and the validation severity | ||
ValidationReport r = pdf.validate(ValidationLevel.BASIC_SIGNATURES, x509CertificateTrustSource); | ||
|
||
// get the result of the validation process | ||
System.out.println(r.getValidationResult()); | ||
|
||
} catch (Exception e) { | ||
System.out.println(e.getMessage()); | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### PDF Validation using a Java trustore | ||
|
||
```java | ||
import gr.grnet.eseal.KeyStoreType; | ||
import gr.grnet.eseal.KeystoreTrustSource; | ||
import gr.grnet.eseal.PDFValidator; | ||
import gr.grnet.eseal.ValidationReport; | ||
import gr.grnet.eseal.ValidationLevel; | ||
|
||
public class Example2 | ||
{ | ||
public static void main( String[] args ) { | ||
|
||
// Initialise the pdf validator from a file source | ||
PDFValidator pdf = new PDFValidator("/path/to/pdf"); | ||
|
||
|
||
try { | ||
|
||
String keystorePath = "/path/to/trustore"; | ||
String password = "eseal12345"; | ||
|
||
// Initialise the trustore trust source from a file source | ||
KeystoreTrustSource keystoreTrustSource = new KeystoreTrustSource(keystorePath, password, KeyStoreType.JKS); | ||
|
||
// Validate the document based on the provided trust source(trustore) and the validation severity | ||
ValidationReport r = pdf.validate(ValidationLevel.BASIC_SIGNATURES, keystoreTrustSource); | ||
|
||
// get the result of the validation process | ||
System.out.println(r.getValidationResult()); | ||
|
||
} catch (Exception e) { | ||
System.out.println(e.getMessage()); | ||
} | ||
} | ||
} | ||
|
||
``` | ||
|
||
### PDF Validation using a Trusted List | ||
|
||
```java | ||
import gr.grnet.eseal.PDFValidator; | ||
import gr.grnet.eseal.TLTrustSource; | ||
import gr.grnet.eseal.ValidationLevel; | ||
import gr.grnet.eseal.ValidationReport; | ||
import gr.grnet.eseal.TrustedListURL; | ||
|
||
public class Example3 { | ||
|
||
public static void main( String[] args ) { | ||
|
||
// Initialise the pdf validator from a file source | ||
PDFValidator pdf = new PDFValidator("/path/to/pdf"); | ||
|
||
|
||
try { | ||
|
||
// Initialise the trusted list source with the greek trusted list( https://www.eett.gr/tsl/EL-TSL.xml) | ||
TLTrustSource tlTrustSource = new TLTrustSource(TrustedListURL.GREECE); | ||
|
||
// Validate the document based on the provided trust source(trusted list) and the validation severity | ||
ValidationReport r = pdf.validate(ValidationLevel.BASIC_SIGNATURES, tlTrustSource); | ||
|
||
// get the result of the validation process | ||
System.out.println(r.getValidationResult()); | ||
|
||
} catch (Exception e) { | ||
System.out.println(e.getMessage()); | ||
} | ||
} | ||
} | ||
|
||
``` | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
eseal/src/main/java/gr/grnet/eseal/KeystoreTrustSource.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.