Package org.keyczar

Examples of org.keyczar.KeyMetadata


    }

    @Override
    public void start() throws Exception {
        String nameFlag = "DNS secret keystore";
        KeyMetadata kmd = new KeyMetadata(nameFlag, KeyPurpose.DECRYPT_AND_ENCRYPT, DefaultKeyType.AES);
        sharedKeystore.ensureCreated(KEY, kmd);
    }
View Full Code Here


    }

    @Override
    public void start() throws Exception {
        String nameFlag = "Compute secret keystore";
        KeyMetadata kmd = new KeyMetadata(nameFlag, KeyPurpose.DECRYPT_AND_ENCRYPT, DefaultKeyType.AES);
        sharedKeystore.ensureCreated(KEY, kmd);
    }
View Full Code Here

        return true;
    }

    public KeyczarKey generateKeypair() {
        try {
            KeyczarKey keypair = KeyczarUtils.createKey(new KeyMetadata("RSA Key", KeyPurpose.DECRYPT_AND_ENCRYPT,
                    DefaultKeyType.RSA_PRIV));
            return keypair;
        } catch (Exception e) {
            throw new IllegalStateException("Error generating keypair", e);
        }
View Full Code Here

            Crypter crypter = null;
            GenericKeyczar store = keyczarFactory.find(Secrets.KEY_TOKEN_ENCRYPT, crypter);
            if (store == null) {
                String nameFlag = "Authentication Token Encryption";

                KeyMetadata kmd = new KeyMetadata(nameFlag, KeyPurpose.DECRYPT_AND_ENCRYPT, DefaultKeyType.RSA_PRIV);
                store = keyczarFactory.create(Secrets.KEY_TOKEN_ENCRYPT, kmd, crypter);
            }
            keyczarFactory.ensureKeyCreated(store);
        }

        {
            Crypter crypter = null;
            GenericKeyczar store = keyczarFactory.find(SharedSecretTokenService.KEYSTORE_ID, crypter);
            if (store == null) {
                String nameFlag = "Authentication Token Signing";

                KeyMetadata kmd = new KeyMetadata(nameFlag, KeyPurpose.SIGN_AND_VERIFY, DefaultKeyType.HMAC_SHA1);
                store = keyczarFactory.create(SharedSecretTokenService.KEYSTORE_ID, kmd, crypter);
            }
            keyczarFactory.ensureKeyCreated(store);
        }
View Full Code Here

            } 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);
            }
        }

        {
View Full Code Here

            Migrations.report(userData);

            UserData.Builder userDataBuilder = UserData.newBuilder(userData);
            UserSecretData.Builder userSecretDataBuilder = UserSecretData.newBuilder(userSecretData);

            KeyczarKey keypair = KeyczarUtils.createKey(new KeyMetadata("RSA Key", KeyPurpose.DECRYPT_AND_ENCRYPT,
                    DefaultKeyType.RSA_PRIV));

            if (userSecretDataBuilder.getPrivateKeyBuilder().hasKeyczar()) {
                throw new IllegalStateException();
            }
View Full Code Here

        if (challengeKey != null) {
            secretService.addPublicKeyAuth(user, challengeKey, request.publicKeyChallengeResponse);
        }

        KeyczarKey keypair = KeyczarUtils.createKey(new KeyMetadata("RSA Key", KeyPurpose.DECRYPT_AND_ENCRYPT,
                DefaultKeyType.RSA_PRIV));

        user.getPublicKeyBuilder().setKeyczar(KeyczarUtils.getPublicKey(keypair).toString());

        // Create the secret data
View Full Code Here

TOP

Related Classes of org.keyczar.KeyMetadata

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.