Skip to content

Commit

Permalink
update Certificate structure and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbooks committed Nov 11, 2017
1 parent f461f00 commit 3603fd0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Step 2: Add dependency to pom.xml:
<dependency>
<groupId>com.github.CaliDog</groupId>
<artifactId>certstream-java</artifactId>
<version>0.1</version>
<version>0.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion src/example/ExampleClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ExampleClient {
public static void main(String[] args)
{
//string version of the message
CertStream.onMessageString(System.out::println);
//CertStream.onMessageString(System.out::println);


CertStream.onMessage(msg -> System.out.println(new Gson().toJson(msg)));
Expand Down
14 changes: 13 additions & 1 deletion src/io/calidog/certstream/CertStreamCertificate.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ public class CertStreamCertificate extends X509Certificate {

private String asDer;

String serialNumber;

String fingerprint;

String[] allDomains;

private CertStreamCertificate() {}

public static Certificate fromPOJO(CertStreamCertificatePOJO pojo) throws CertificateException {
public static CertStreamCertificate fromPOJO(CertStreamCertificatePOJO pojo) throws CertificateException {
CertStreamCertificate fullCertificate = new CertStreamCertificate();

if (pojo.asDer.isEmpty())
Expand All @@ -42,6 +48,12 @@ public static Certificate fromPOJO(CertStreamCertificatePOJO pojo) throws Certif

fullCertificate.subject = pojo.subject;

fullCertificate.serialNumber = pojo.serialNumber;

fullCertificate.fingerprint = pojo.fingerprint;

fullCertificate.allDomains = pojo.allDomains;

return fullCertificate;
}

Expand Down
7 changes: 7 additions & 0 deletions src/io/calidog/certstream/CertStreamCertificatePOJO.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ public class CertStreamCertificatePOJO {
@SerializedName("as_der")
String asDer;

@SerializedName("serial_number")
String serialNumber;

String fingerprint;

@SerializedName("all_domains")
String[] allDomains;
}
4 changes: 2 additions & 2 deletions src/io/calidog/certstream/CertStreamMessageData.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public class CertStreamMessageData {

String updateType;

Certificate leafCert;
CertStreamCertificate leafCert;

Certificate[] chain;
CertStreamCertificate[] chain;

long certIndex;

Expand Down

0 comments on commit 3603fd0

Please sign in to comment.