Package br.net.woodstock.rockframework.security

Examples of br.net.woodstock.rockframework.security.Alias


      Assert.notNull(entry, "entry");
      Assert.notNull(entry.getAlias(), "entry.alias");
      Assert.notNull(entry.getType(), "entry.type");
      Assert.notNull(entry.getValue(), "entry.value");

      Alias alias = entry.getAlias();
      String name = alias.getName();
      Object value = entry.getValue();
      String password = null;

      if (alias instanceof PasswordAlias) {
        PasswordAlias pa = (PasswordAlias) alias;
View Full Code Here


            Date date = pk.getSignDate().getTime();
            Boolean valid = Boolean.TRUE;
            Signatory signatory = this.toSignatory(certificate);

            Store store = new JCAStore(KeyStoreType.JKS);
            store.add(new CertificateEntry(new Alias(certificate.getSerialNumber().toString()), certificate));

            if (pk.verify()) {
              valid = Boolean.FALSE;
            }
View Full Code Here

    Assert.notNull(entry, "entry");
    Assert.notNull(entry.getAlias(), "entry.alias");
    Assert.notNull(entry.getType(), "entry.type");
    Assert.notNull(entry.getValue(), "entry.value");

    Alias alias = entry.getAlias();
    String name = alias.getName();
    Object value = entry.getValue();

    switch (entry.getType()) {
      case CERTIFICATE:
        this.certificateMap.put(name, (Certificate) value);
View Full Code Here

  @Override
  public KeyStore toKeyStore() {
    JCAStore jcaStore = new JCAStore(KeyStoreType.JKS);
    for (Entry<String, Certificate> entry : this.certificateMap.entrySet()) {
      jcaStore.add(new CertificateEntry(new Alias(entry.getKey()), entry.getValue()));
    }
    for (Entry<String, Identity> entry : this.privateKeyMap.entrySet()) {
      jcaStore.add(new PrivateKeyEntry(new Alias(entry.getKey()), entry.getValue().getPrivateKey(), entry.getValue().getChain()));
    }
    for (Entry<String, PublicKey> entry : this.publicKeyMap.entrySet()) {
      jcaStore.add(new PublicKeyEntry(new Alias(entry.getKey()), entry.getValue()));
    }
    for (Entry<String, SecretKey> entry : this.secretKeyMap.entrySet()) {
      jcaStore.add(new SecretKeyEntry(new Alias(entry.getKey()), entry.getValue()));
    }
    return jcaStore.toKeyStore();
  }
View Full Code Here

      InputStream inputStream = ClassLoaderUtils.getResourceAsStream(timeStampConfig.getStoreResource());

      Store store = new JCAStore(KeyStoreType.valueOf(timeStampConfig.getStoreType()));
      store.read(inputStream, timeStampConfig.getStorePassword());

      Alias alias = new PasswordAlias(timeStampConfig.getKeyAlias(), timeStampConfig.getKeyPassword());

      this.timeStampServer = new BouncyCastleTimeStampServer(store, alias);
    } catch (Exception e) {
      throw new ServletException(e);
    }
View Full Code Here

            Date date = pk.getSignDate().getTime();
            Boolean valid = Boolean.TRUE;
            Signatory signatory = this.toSignatory(certificate);

            Store store = new JCAStore(KeyStoreType.JKS);
            store.add(new CertificateEntry(new Alias(certificate.getSerialNumber().toString()), certificate));

            if (pk.verify()) {
              valid = Boolean.FALSE;
            }
View Full Code Here

    this.store = store;
  }

  public SignatureRequest(final PrivateKeyHolder privateKeyHolder) {
    super();
    Alias alias = new Alias(SignatureRequest.DEFAULT_ALIAS_NAME);
    this.store = new MemoryStore();
    this.aliases = new Alias[] { alias };
    this.store.add(new PrivateKeyEntry(alias, privateKeyHolder.getPrivateKey(), privateKeyHolder.getChain()));
  }
View Full Code Here

            Date date = pk.getSignDate().getTime();
            Boolean valid = Boolean.TRUE;
            Signatory signatory = this.toSignatory(certificate);

            Store store = new JCAStore(KeyStoreType.JKS);
            store.add(new CertificateEntry(new Alias(certificate.getSerialNumber().toString()), certificate));
            Object[] fails = PdfPKCS7.verifyCertificates(chain, store.toKeyStore(), pk.getCRLs(), pk.getSignDate());
            if (ConditionUtils.isNotEmpty(fails)) {
              valid = Boolean.FALSE;
            }
View Full Code Here

    try {
      Enumeration<String> aliases = this.keyStore.aliases();
      List<Alias> list = new ArrayList<Alias>();
      while (aliases.hasMoreElements()) {
        String alias = aliases.nextElement();
        list.add(new Alias(alias));
      }
      return CollectionUtils.toArray(list, Alias.class);
    } catch (GeneralSecurityException e) {
      throw new StoreException(e);
    }
View Full Code Here

      Assert.notNull(entry, "entry");
      Assert.notNull(entry.getAlias(), "entry.alias");
      Assert.notNull(entry.getType(), "entry.type");
      Assert.notNull(entry.getValue(), "entry.value");

      Alias alias = entry.getAlias();
      String name = alias.getName();
      Object value = entry.getValue();
      String password = null;

      if (alias instanceof PasswordAlias) {
        PasswordAlias pa = (PasswordAlias) alias;
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.security.Alias

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.