Skip to content

Commit

Permalink
Merge pull request #6 from ARGOeu/revert-4-tl-ts
Browse files Browse the repository at this point in the history
Revert "ET-29 TL source trust source"
  • Loading branch information
kaggis authored Sep 18, 2020
2 parents 3c89237 + cb466e9 commit 7dee037
Show file tree
Hide file tree
Showing 21 changed files with 0 additions and 1,174 deletions.
50 changes: 0 additions & 50 deletions Jenkinsfile

This file was deleted.

110 changes: 0 additions & 110 deletions README.md
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());
}
}
}

```

4 changes: 0 additions & 4 deletions eseal/.gitignore

This file was deleted.

108 changes: 0 additions & 108 deletions eseal/pom.xml

This file was deleted.

9 changes: 0 additions & 9 deletions eseal/src/main/java/gr/grnet/eseal/KeyStoreType.java

This file was deleted.

54 changes: 0 additions & 54 deletions eseal/src/main/java/gr/grnet/eseal/KeystoreTrustSource.java

This file was deleted.

Loading

0 comments on commit 7dee037

Please sign in to comment.