Package br.net.woodstock.rockframework.security

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


  public String getSignAlgorithm() {
    return this.getSignType().getAlgorithm();
  }

  public PrivateKey getIssuerPrivateKey() {
    Identity identity = this.getIssuer();
    if (identity != null) {
      return identity.getPrivateKey();
    }
    return null;
  }
View Full Code Here


    }
    return null;
  }

  public X509Certificate getIssuerCertificate() {
    Identity identity = this.getIssuer();
    if (identity != null) {
      Certificate[] chain = identity.getChain();
      if (ConditionUtils.isNotEmpty(chain)) {
        return (X509Certificate) chain[0];
      }
    }
    return null;
View Full Code Here

    }
    return null;
  }

  public X500Name getIssuerX500Name() {
    Identity identity = this.getIssuer();
    if (identity != null) {
      Certificate[] chain = identity.getChain();
      if (ConditionUtils.isNotEmpty(chain)) {
        X509Certificate certificate = (X509Certificate) chain[0];
        return BouncyCastleProviderHelper.toX500Name(certificate.getIssuerX500Principal());
      }
    }
View Full Code Here

  public String getSignAlgorithm() {
    return this.getSignType().getAlgorithm();
  }

  public PrivateKey getIssuerPrivateKey() {
    Identity identity = this.getIssuerIdentity();
    if (identity != null) {
      return identity.getPrivateKey();
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  public X509Certificate getIssuerCertificate() {
    Identity identity = this.getIssuerIdentity();
    if (identity != null) {
      Certificate[] chain = identity.getChain();
      if (ConditionUtils.isNotEmpty(chain)) {
        return (X509Certificate) chain[0];
      }
    }
    return null;
View Full Code Here

        if (certificate != null) {
          entry = new CertificateEntry(alias, certificate);
        }
        break;
      case PRIVATE_KEY:
        Identity identity = this.privateKeyMap.get(alias.getName());
        if (identity != null) {
          entry = new PrivateKeyEntry(alias, identity.getPrivateKey(), identity.getChain());
        }
        break;
      case PUBLIC_KEY:
        PublicKey publicKey = this.publicKeyMap.get(alias.getName());
        if (publicKey != null) {
View Full Code Here

    switch (entry.getType()) {
      case CERTIFICATE:
        this.certificateMap.put(name, (Certificate) value);
        break;
      case PRIVATE_KEY:
        this.privateKeyMap.put(name, new Identity((PrivateKey) value, ((PrivateKeyEntry) entry).getChain()));
        break;
      case PUBLIC_KEY:
        this.publicKeyMap.put(name, (PublicKey) value);
        break;
      case SECRET_KEY:
View Full Code Here

        this.getCertificateMap().put(alias, certificate);
      }

      for (XmlElement privateKeyElement : privateKeys.getElements()) {
        String alias = privateKeyElement.getAttribute(XMLStore.ALIAS_ATTRIBUTE);
        Identity holder = this.getPrivateKey(privateKeyElement, encoding);
        this.getPrivateKeyMap().put(alias, holder);
      }

      for (XmlElement publicKeyElement : publicKeys.getElements()) {
        String alias = publicKeyElement.getAttribute(XMLStore.ALIAS_ATTRIBUTE);
View Full Code Here

        Certificate certificate = entry.getValue();
        this.addCertificateElement(certificates, alias, certificate);
      }
      for (Entry<String, Identity> entry : this.getPrivateKeyMap().entrySet()) {
        String alias = entry.getKey();
        Identity identity = entry.getValue();
        this.addPrivateKeyElement(privateKeys, alias, identity);
      }
      for (Entry<String, PublicKey> entry : this.getPublicKeyMap().entrySet()) {
        String alias = entry.getKey();
        PublicKey publicKey = entry.getValue();
View Full Code Here

    if (chainList.size() > 0) {
      chain = CollectionUtils.toArray(chainList, Certificate.class);
    }

    Identity identity = new Identity(privateKey, chain);
    return identity;
  }
View Full Code Here

TOP

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

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.