Package org.bouncycastle.openssl

Examples of org.bouncycastle.openssl.PasswordFinder


    PrivateKey jkey = null;
    java.security.cert.Certificate jcert = null;
   
    try {
     
      PasswordFinder passwordFinder = null;
     
      if (key.getKeyPassphrase() != null) {
        passwordFinder = new PasswordFinder() {
         
          @Override
          public char[] getPassword() {
            return key.getKeyPassphrase().toCharArray();
          }
View Full Code Here


            try {
                final Properties p = Play.configuration;

                keyReader = new PEMReader(new FileReader(Play.getFile(p.getProperty("certificate.key.file",
                                                                                               "conf/host.key"))),
                                                    new PasswordFinder() {
                    public char[] getPassword() {
                        return p.getProperty("certificate.password", "secret").toCharArray();
                    }
                });
                key = ((KeyPair) keyReader.readObject()).getPrivate();
View Full Code Here

            try {
                final Properties p = Yalp.configuration;

                PEMReader keyReader = new PEMReader(new FileReader(Yalp.getFile(p.getProperty("certificate.key.file",
                        "conf/host.key"))),
                        new PasswordFinder() {
                            public char[] getPassword() {
                                return p.getProperty("certificate.password", "secret").toCharArray();
                            }
                        });
                key = ((KeyPair) keyReader.readObject()).getPrivate();
View Full Code Here

            try {
                final PEMReader pemReader;
                if (pemPassword == null) {
                    pemReader = new PEMReader(pemFileReader);
                } else {
                    final PasswordFinder passwordFinder = new CRXPasswordFinder(pemPassword);
                    pemReader = new PEMReader(pemFileReader, passwordFinder);
                }
                try {
                    final Object pemObject = pemReader.readObject();
                    if (pemObject instanceof KeyPair) {
View Full Code Here

    }

    public PrivateKey parsePrivateKey(String key, String password) throws IOException {

        PasswordFinder pGet = null;

        if (password != null)
            pGet = new KeyPassword(password.toCharArray());

        PEMReader privateKey = new PEMReader(new StringReader(key), pGet);
View Full Code Here

    }

    public void performTest()
        throws Exception
    {
        PasswordFinder  pGet = new Password("secret".toCharArray());
        PEMReader       pemRd = openPEMResource("test.pem", pGet);
        Object          o;
        KeyPair         pair;

        while ((o = pemRd.readObject()) != null)
View Full Code Here

    }

    public PrivateKey parsePrivateKey(String key, String password) throws IOException {

        PasswordFinder pGet = null;

        if( password != null )
               pGet = new KeyPassword(password.toCharArray());

          PEMReader privateKey = new PEMReader(new StringReader(key), pGet);
View Full Code Here

TOP

Related Classes of org.bouncycastle.openssl.PasswordFinder

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.