Package es.zoocial.tsa

Examples of es.zoocial.tsa.KeystoreHandler


      log.info(String.format("Configuring servlet with file '%s'", configurationFile));
     
      Configuration conf = new Configuration();
      conf.loadConfiguration(configurationFile);
     
      KeystoreHandler store = new KeystoreHandler();
      store.loadKeystore(KeystoreModel.fromMap(conf.getPropertySet("keystore")));
      stamper = new Timestamper(store);
     
      log.info("Servlet launched");
    }
View Full Code Here


public class KeyStoreTest {
 
  @Test
  public void testGetCertificateChain() throws KeyStoreException {
    KeystoreHandler keystore = KeystoreHelper.getP12Keystore();
    org.junit.Assert.assertNotNull("Certificate chain", keystore.getCertChain());
  }
View Full Code Here

  }

 
  @Test
  public void testGetCertificate() throws KeyStoreException {
    KeystoreHandler keystore = KeystoreHelper.getP12Keystore();
    org.junit.Assert.assertNotNull("Certificate", keystore.getCertificate());
  }
View Full Code Here

  }

 
  @Test
  public void testGetPrivateKey() throws UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException {
    KeystoreHandler keystore = KeystoreHelper.getP12Keystore();
    org.junit.Assert.assertNotNull("Private Key", keystore.getPrivateKey());
  }
View Full Code Here

    org.junit.Assert.assertNotNull("Private Key", keystore.getPrivateKey());
  }
 
  @Test
  public void testGetPublicKey() throws KeyStoreException {
    KeystoreHandler keystore = KeystoreHelper.getP12Keystore();
    org.junit.Assert.assertNotNull("Public Key", keystore.getPublicKey());
  }
View Full Code Here

public class TimestampRequestTest {
 
  @Test
  public void testTimestamp() throws TSPException {
    KeystoreHandler keystore = KeystoreHelper.getP12Keystore();
   
    TimeStampRequestGenerator generator = new TimeStampRequestGenerator();
    TimeStampRequest timeStampRequest = generator.generate(
        TSPAlgorithms.SHA1, DigestHelper.digest("this is a test message"));
   
View Full Code Here

  }

 
  @Test(expected=TSPException.class)
  public void testTimestampValidateWithOtherRequest() throws TSPException {
    KeystoreHandler keystore = KeystoreHelper.getP12Keystore();
   
    TimeStampRequestGenerator generator = new TimeStampRequestGenerator();
    TimeStampRequest timeStampRequest = generator.generate(
        TSPAlgorithms.SHA1, DigestHelper.digest("this is a test message"));
View Full Code Here

        url = new URL("file:cert/tsa.p12");
      } catch (MalformedURLException e) {
        throw new RuntimeException(e);
      }
      propertySet.put("keystorefile", new File(url.getFile()).getAbsolutePath());
      KeystoreHandler handler = new KeystoreHandler();
      handler.loadKeystore(KeystoreModel.fromMap(propertySet));
      keystore = handler;
    }
    return keystore;
  }
View Full Code Here

TOP

Related Classes of es.zoocial.tsa.KeystoreHandler

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.