Package org.keyczar

Examples of org.keyczar.KeyczarFileReader


        String metadata = null;

        {
            path.mkdirs();

            KeyczarFileReader store = new KeyczarFileReader(path.getAbsolutePath());

            try {
                metadata = store.getMetadata();
            } catch (Exception e) {
                log.info("Metadata not found");
            }

            if (metadata == null) {
                KeyMetadata kmd = new KeyMetadata(nameFlag, KeyPurpose.DECRYPT_AND_ENCRYPT, DefaultKeyType.RSA_PRIV);
                GenericKeyczar.create(store, kmd);
            }
        }

        {
            KeyczarFileReader store = new KeyczarFileReader(path.getAbsolutePath());

            GenericKeyczar keyczar = new GenericKeyczar(store);

            for (KeyVersion version : keyczar.getVersions()) {
                log.info("Local password recovery key already exists; exiting for safety");
View Full Code Here


            path = IoUtils.resolve("~/passwordrecovery");
        }

        log.info("Loading password-recovery key from {}", path);

        KeyczarFileReader store = new KeyczarFileReader(path.getAbsolutePath());

        DomainData domain = identityService.getDefaultDomain();
        loginService.changePassword(domain, username, password, store);
    }
View Full Code Here

      String algorithm, String crypterAlgorithm, String pubKey) throws KeyczarException {
    String keysetName = algorithm + crypterAlgorithm;
    if (pubKey != null) {
      keysetName += pubKey;
    }
    KeyczarReader reader = new KeyczarFileReader(getKeyPath(keysetName));
    if (!crypterAlgorithm.equals("")) {
      Crypter crypter = new Crypter(getKeyPath(crypterAlgorithm));
      reader = new KeyczarEncryptedReader(reader, crypter);
    }
    return reader;
View Full Code Here

TOP

Related Classes of org.keyczar.KeyczarFileReader

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.