Package iaik.pkcs.pkcs12

Examples of iaik.pkcs.pkcs12.KeyBag


        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag)
        {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0))
        {
            throw new PKCSException("No certificates found");
View Full Code Here


        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag) {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0)) {
            throw new PKCSException("No certificates found");
        }
View Full Code Here

        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag) {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0)) {
            throw new PKCSException("No certificates found");
        }
View Full Code Here

        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag)
        {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0))
        {
            throw new PKCSException("No certificates found");
View Full Code Here

     * Process PKCS12 input stream into the private key and certificate chain.
     */
    public void load(InputStream is, String pword)
        throws IOException, PKCSException, CertificateException
    {
        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag)
        {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0))
        {
            throw new PKCSException("No certificates found");
        }

View Full Code Here

    /**
     * Process PKCS12 input stream into the private key and certificate chain.
     */
    public void load(InputStream is, String pword)
    throws IOException, PKCSException, CertificateException {
        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag) {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0)) {
            throw new PKCSException("No certificates found");
        }

        this.alias = new String(keyBagLocalKeyId);
View Full Code Here

    /**
     * Process PKCS12 input stream into the private key and certificate chain.
     */
    public void load(InputStream is, String pword)
    throws IOException, PKCSException, CertificateException {
        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag) {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0)) {
            throw new PKCSException("No certificates found");
        }

        this.alias = new String(keyBagLocalKeyId);
View Full Code Here

     * Process PKCS12 input stream into the private key and certificate chain.
     */
    public void load(InputStream is, String pword)
        throws IOException, PKCSException, CertificateException
    {
        PKCS12 p12 = new PKCS12(is);
        is.close();

        p12.decrypt(pword.toCharArray());

        KeyBag keyBag = p12.getKeyBag();

        if (null == keyBag)
        {
            throw new PKCSException("No private key found");
        }

        byte[] keyBagLocalKeyId = keyBag.getLocalKeyID();

        this.key = keyBag.getPrivateKey();

        CertificateBag[] certBags = p12.getCertificateBags();
        if ((null == certBags) || (certBags.length == 0))
        {
            throw new PKCSException("No certificates found");
        }

View Full Code Here

  public void validateDiscardTransferToken(EntityManager em, DiscardTransferToken body) throws DispositionReportFaultMessage {
    // No null input
    if (body == null)
      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    KeyBag keyBag = body.getKeyBag();
   
    // The call must contain at least a transfer token or keyBag
    if (body.getTransferToken() == null && keyBag == null)
      throw new FatalErrorException(new ErrorMessage("errors.discardtransfertoken.NoInput"));
   
    if (keyBag != null) {
      List<String> keyList = keyBag.getKey();
      if (keyList == null || keyList.size() == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
     
      // Test that publisher owns keys using operational info.
      for (String key : keyList) {
View Full Code Here

   
    org.uddi.custody_v3.TransferToken apiTransferToken = body.getTransferToken();
    if (apiTransferToken == null)
      throw new FatalErrorException(new ErrorMessage("errors.transfertoken.NullInput"));
   
    KeyBag keyBag = body.getKeyBag();
    if (keyBag == null)
      throw new FatalErrorException(new ErrorMessage("errors.keybag.NullInput"));
   
    List<String> apiKeyList = keyBag.getKey();
    if (apiKeyList == null || apiKeyList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
   
    String transferTokenId = new String(apiTransferToken.getOpaqueToken());
    org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
View Full Code Here

TOP

Related Classes of iaik.pkcs.pkcs12.KeyBag

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.