Package org.sharpsw.crlserver.data

Examples of org.sharpsw.crlserver.data.RevokedCertificate


    this.service = new RevokedCertificateDAO(this.getSession(), this.getBatchSize(), true);
  }
 
  @Test(expected = IllegalArgumentException.class)
  public void testCreateRevokedCertificateNullArgFail() throws CreateException {
    RevokedCertificate certificate = null;
    this.service.save(certificate);
  }
View Full Code Here


    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
    issuer.setDescription("AC Secretaria da Receita Federal do Brasil");
   
    RevokedCertificateCompositePrimaryKey pk = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344"));
    RevokedCertificate certificate = new RevokedCertificate(pk);
   
    Calendar ts = Calendar.getInstance();
    ts.set(Calendar.YEAR, 2012);
    ts.set(Calendar.MONTH, Calendar.MARCH);
    ts.set(Calendar.DATE, 31);
    ts.set(Calendar.HOUR_OF_DAY, 11);
    ts.set(Calendar.MINUTE, 15);
    ts.set(Calendar.SECOND, 59);
    ts.set(Calendar.MILLISECOND, 0);
   
    certificate.setRevocationTimestamp(ts);
    certificate.setRevocationReason("UserRequest");
   
    this.service.save(certificate);
   
    StringBuffer dataSetFile = new StringBuffer();
    dataSetFile.append("config").append(File.separator).append("RevokedCertificateDAO").append(File.separator).append("testCreateRevokedCertificateOK.xml");
View Full Code Here

    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
    issuer.setDescription("AC Secretaria da Receita Federal do Brasil");

    RevokedCertificateCompositePrimaryKey key1 = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344"));
    RevokedCertificate cert1 = new RevokedCertificate(key1);
   
    RevokedCertificateCompositePrimaryKey key2 = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("22334455"));
    RevokedCertificate cert2 = new RevokedCertificate(key2);
   
    Calendar ts1 = Calendar.getInstance();
    ts1.set(Calendar.YEAR, 2011);
    ts1.set(Calendar.MONTH, Calendar.JUNE);
    ts1.set(Calendar.DATE, 1);
    ts1.set(Calendar.HOUR_OF_DAY, 8);
    ts1.set(Calendar.MINUTE, 9);
    ts1.set(Calendar.SECOND, 10);
    ts1.set(Calendar.MILLISECOND, 0);
   
    cert1.setRevocationReason("UserRequest");
    cert1.setRevocationTimestamp(ts1);
   
    Calendar ts2 = Calendar.getInstance();
    ts2.set(Calendar.YEAR, 2012);
    ts2.set(Calendar.MONTH, Calendar.JULY);
    ts2.set(Calendar.DATE, 20);
    ts2.set(Calendar.HOUR_OF_DAY, 15);
    ts2.set(Calendar.MINUTE, 10);
    ts2.set(Calendar.SECOND, 49);
    ts2.set(Calendar.MILLISECOND, 0);
   
    cert2.setRevocationReason("LostCertificate");
    cert2.setRevocationTimestamp(ts2);
   
    Set<RevokedCertificate> certificates = new HashSet<RevokedCertificate>();
    certificates.add(cert2);
    certificates.add(cert1);
   
View Full Code Here

    CRLIssuer issuer = new CRLIssuer();
    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
   
    RevokedCertificateCompositePrimaryKey pk = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344"));
    RevokedCertificate certificate = this.service.findByPrimaryKey(pk);
   
    RevokedCertificate expected = new RevokedCertificate();
    expected.setPrimaryKey(new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344")));
    expected.setRevocationReason("UserRequest");
    Calendar ts = Calendar.getInstance();
    ts.set(Calendar.YEAR, 2012);
    ts.set(Calendar.MONTH, Calendar.JANUARY);
    ts.set(Calendar.DATE, 1);
    ts.set(Calendar.HOUR_OF_DAY, 22);
    ts.set(Calendar.MINUTE, 39);
    ts.set(Calendar.SECOND, 10);
    ts.set(Calendar.MILLISECOND, 0);
    expected.setRevocationTimestamp(ts);
   
    Assert.assertEquals(expected, certificate);
  }
View Full Code Here

  public void testUpdateRevocationTimestampOK() throws Exception {
    CRLIssuer issuer = new CRLIssuer();
    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
   
    RevokedCertificate certificate = new RevokedCertificate();
    RevokedCertificateCompositePrimaryKey pk = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344"));
    certificate.setPrimaryKey(pk);
   
    Calendar ts = Calendar.getInstance();
    ts.set(Calendar.YEAR, 2011);
    ts.set(Calendar.MONTH, Calendar.DECEMBER);
    ts.set(Calendar.DATE, 30);
    ts.set(Calendar.HOUR_OF_DAY, 12);
    ts.set(Calendar.MINUTE, 12);
    ts.set(Calendar.SECOND, 0);
    ts.set(Calendar.MILLISECOND, 0);
   
    certificate.setRevocationTimestamp(ts);
    certificate.setRevocationReason("UserRequest");
   
    this.service.update(certificate);
   
    StringBuffer dataSetFile = new StringBuffer();
    dataSetFile.append("config").append(File.separator).append("RevokedCertificateDAO").append(File.separator).append("testUpdateRevocationTimestampOK.xml");
View Full Code Here

  public void testUpdateRevocationReasonOK() throws Exception {
    CRLIssuer issuer = new CRLIssuer();
    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
   
    RevokedCertificate certificate = new RevokedCertificate();
    RevokedCertificateCompositePrimaryKey pk = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344"));
    certificate.setPrimaryKey(pk);
   
    Calendar ts = Calendar.getInstance();
    ts.set(Calendar.YEAR, 2011);
    ts.set(Calendar.MONTH, Calendar.DECEMBER);
    ts.set(Calendar.DATE, 30);
    ts.set(Calendar.HOUR_OF_DAY, 12);
    ts.set(Calendar.MINUTE, 12);
    ts.set(Calendar.SECOND, 0);
    ts.set(Calendar.MILLISECOND, 0);
   
    certificate.setRevocationTimestamp(ts);
    certificate.setRevocationReason("CertificateLost");
   
    this.service.update(certificate);
   
    StringBuffer dataSetFile = new StringBuffer();
    dataSetFile.append("config").append(File.separator).append("RevokedCertificateDAO").append(File.separator).append("testUpdateRevocationReasonOK.xml");
View Full Code Here

    Assertion.assertEquals(expectedSortedTable, actualSortedTable);
  }
 
  @Test(expected = IllegalArgumentException.class)
  public void testUpdateNullArgFail() throws UpdateException {
    RevokedCertificate certificate = null;
    this.service.update(certificate);
  }
View Full Code Here

  public void testDeleteSingleCertificateOK() throws Exception {
    CRLIssuer issuer = new CRLIssuer();
    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
   
    RevokedCertificate certificate = new RevokedCertificate();
    RevokedCertificateCompositePrimaryKey pk = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344"));
    certificate.setPrimaryKey(pk);
   
    this.service.delete(certificate);
   
    StringBuffer dataSetFile = new StringBuffer();
    dataSetFile.append("config").append(File.separator).append("RevokedCertificateDAO").append(File.separator).append("testDeleteSingleCertificateOK.xml");
View Full Code Here

    Assertion.assertEquals(expectedSortedTable, actualSortedTable);
  }
 
  @Test(expected = IllegalArgumentException.class)
  public void testDeleteNullArgumentFail() throws DeleteException {
    RevokedCertificate certificate = null;
    this.service.delete(certificate);
  }
View Full Code Here

    CRLIssuer issuer = new CRLIssuer();
    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
   
    RevokedCertificateCompositePrimaryKey pk1 = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11223344"));
    RevokedCertificate cert1 = new RevokedCertificate(pk1);
   
    RevokedCertificateCompositePrimaryKey pk2 = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("22334455"));
    RevokedCertificate cert2 = new RevokedCertificate(pk2);
   
    RevokedCertificateCompositePrimaryKey pk3 = new RevokedCertificateCompositePrimaryKey(issuer, new BigInteger("11224433"));
    RevokedCertificate cert3 = new RevokedCertificate(pk3);
   
    Set<RevokedCertificate> certs = new HashSet<RevokedCertificate>();
    certs.add(cert1);
    certs.add(cert2);
    certs.add(cert3);
View Full Code Here

TOP

Related Classes of org.sharpsw.crlserver.data.RevokedCertificate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.