Package org.keyczar.interfaces

Examples of org.keyczar.interfaces.KeyType$KeyTypeDeserializer


    return kmd.getType();
  }

  public boolean addKey(int versionNumber, KeyStatus status)
      throws KeyczarException {
    KeyType type = kmd.getType();
    KeyczarKey key = type.getBuilder().generate(type.applyDefaultParameters(null));
    keys.put(versionNumber, key);
    return kmd.addVersion(new KeyVersion(versionNumber, status, false));
  }
View Full Code Here


   * @param status KeyStatus desired for new key version
   * @param keyParams parameters for new key generation.
   * @throws KeyczarException if key type is unsupported.
   */
  public void addVersion(KeyStatus status, KeyParameters keyParams) throws KeyczarException {
    KeyType type = kmd.getType();
    KeyczarKey key;
    do {
      key = type.getBuilder().generate(keyParams);
    } while (haveKeyWithId(key.hash()));
    addVersion(status, key);
  }
View Full Code Here

    final KeyMetadata destMetadata = destinationKeyczar.getMetadata();
    final GenericKeyczar sourceKeyczar =
        getImportingKeyczar(pemFileFlag, paddingFlag, passphraseFlag, destMetadata.getPurpose());

    // Change destination type if necessary, but only if there aren't any keys in it yet.
    final KeyType sourceKeyType = sourceKeyczar.getMetadata().getType();
    if (destMetadata.getType() != sourceKeyType
        && destinationKeyczar.getVersions().isEmpty()) {
      destMetadata.setType(sourceKeyType);
    }
View Full Code Here

TOP

Related Classes of org.keyczar.interfaces.KeyType$KeyTypeDeserializer

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.