View Javadoc

1   package com.atlassian.security.auth.trustedapps;
2   
3   public class DefaultEncryptedCertificate implements EncryptedCertificate
4   {
5       private final String id;
6       private final String key;
7       private final String certificate;
8       private final Integer protocolVersion;
9       private final String magic;
10  
11      /**
12       * Constructor for protocol '0' certificates
13       *
14       * @param id The application id
15       * @param key The application public key
16       * @param certificate The certificate string
17       */
18      public DefaultEncryptedCertificate(String id, String key, String certificate)
19      {
20          this(id, key, certificate, null, null);
21      }
22  
23      public DefaultEncryptedCertificate(String id, String key, String certificate, Integer protocolVersion, String magic)
24      {
25          Null.not("id", id);
26          Null.not("key", key);
27          Null.not("certificate", certificate);
28  
29          this.id = id;
30          this.key = key;
31          this.certificate = certificate;
32          this.protocolVersion = protocolVersion;
33          this.magic = magic;
34      }
35  
36      public String getCertificate()
37      {
38          return certificate;
39      }
40  
41      public String getID()
42      {
43          return id;
44      }
45  
46      public String getSecretKey()
47      {
48          return key;
49      }
50  
51      public Integer getProtocolVersion()
52      {
53          return protocolVersion;
54      }
55  
56      public String getMagicNumber()
57      {
58          return magic;
59      }
60  }