Package org.globus.gsi

Examples of org.globus.gsi.OpenSSLKey


                           GlobusGSSCredentialImpl userCert,
                           Map attributes)
        throws MyProxyException,GeneralSecurityException {

        X509Certificate[] certs = userCert.getCertificateChain();
        OpenSSLKey key =
            new BouncyCastleOpenSSLKey(userCert.getPrivateKey());
        key.encrypt(password);

        StoreParams param = new StoreParams();
        param.setUserName(username);
        param.setLifetime(maxDelegationLifetime);
        setAttributesTo(param, attributes);
View Full Code Here


   */
  private void loadKey(String keyPath, String pwd)
    throws GeneralSecurityException
  {
    try {
      OpenSSLKey key = new BouncyCastleOpenSSLKey(keyPath);

      if (key.isEncrypted()) {
        key.decrypt(pwd);
      }

      userKey = key.getPrivateKey();

    } catch (IOException e) {
      throw new GeneralSecurityException("Error: Failed to load key: " + keyPath);
    } catch (GeneralSecurityException e) {
      throw new GeneralSecurityException("Error: Wrong pass phrase");
View Full Code Here

        }

        final String pubKeyPEM =
                certToPEMString(Base64.encode(cert.getEncoded()));

        final OpenSSLKey k = new BouncyCastleOpenSSLKey(keyPair.getPrivate());
        final StringWriter writer = new StringWriter();
        k.writeTo(writer);
        final String privKeyPEM = writer.toString();

        final FileWriter pubFile = new FileWriter(pubpath);
        final FileWriter privFile = new FileWriter(privpath);
View Full Code Here

    }

    public void setKeypair(KeyPair keypair) throws IOException {
        this.keypair = keypair;

        OpenSSLKey k = new BouncyCastleOpenSSLKey(keypair.getPrivate());
        StringWriter writer = new StringWriter();
        k.writeTo(writer);
        this.privateString = writer.toString();
    }
View Full Code Here

TOP

Related Classes of org.globus.gsi.OpenSSLKey

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.