Examples of PasswordFinder


Examples of org.bouncycastle.openssl.PasswordFinder

        return false;
    }

    private PasswordFinder getPasswordFinderFor(final String keyPassword)
    {
        PasswordFinder passwordFinder = new PasswordFinder()
        {
            @Override
            public char[] getPassword()
            {
                return keyPassword.toCharArray();
View Full Code Here

Examples of org.bouncycastle.openssl.PasswordFinder

            try {
                final Properties p = Play.configuration;

                PEMReader 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

Examples of org.bouncycastle.openssl.PasswordFinder

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

Examples of org.bouncycastle.openssl.PasswordFinder

  private PEMKeyManager() {
   
    PEMReader reader = null;
    try {
        final HettyConfig hettyConfig =HettyConfig.getInstance();
        reader = new PEMReader(new FileReader(FileUtil.getFile(hettyConfig.getCertificateKeyFile())), new PasswordFinder() {
        public char[] getPassword() {
          return hettyConfig.getCertificatePassword().toCharArray();
        }
      });
      key = ((KeyPair) reader.readObject()).getPrivate();
View Full Code Here

Examples of org.bouncycastle.openssl.PasswordFinder

            .append(" ]").toString();
    }

    private Object readPemObject(String pemFile, String keyPassword, @SuppressWarnings("rawtypes") Class... expectedInterfaces)
    {
        final PasswordFinder passwordFinder;
        if (keyPassword != null)
        {
            passwordFinder = getPasswordFinderFor(keyPassword);
        }
        else
View Full Code Here

Examples of org.bouncycastle.openssl.PasswordFinder

        return false;
    }

    private PasswordFinder getPasswordFinderFor(final String keyPassword)
    {
        PasswordFinder passwordFinder = new PasswordFinder()
        {
            @Override
            public char[] getPassword()
            {
                return keyPassword.toCharArray();
View Full Code Here

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

Examples of org.bouncycastle.openssl.PasswordFinder

            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

Examples of org.bouncycastle.openssl.PasswordFinder

            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

Examples of org.bouncycastle.openssl.PasswordFinder

            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
TOP
Copyright © 2018 www.massapi.com. 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.