Examples of KeyVersion


Examples of com.amazonaws.services.s3.model.DeleteObjectsRequest.KeyVersion

                }
                list = client.listObjects(bucket, keyPath);
                multiObjectDeleteRequest = new DeleteObjectsRequest(list.getBucketName());
            }
            for (S3ObjectSummary summary : list.getObjectSummaries()) {
                keys.add(new KeyVersion(summary.getKey()));
                //Every 500 objects batch the delete request
                if (keys.size() > 500) {
                    multiObjectDeleteRequest.setKeys(keys);
                    client.deleteObjects(multiObjectDeleteRequest);
                    multiObjectDeleteRequest = new DeleteObjectsRequest(list.getBucketName());
View Full Code Here

Examples of com.google.k2crypto.keyversions.KeyVersion

  @Test
  public void testCreateAddKeyVersionToKey() throws BuilderException {
    // create a key modifier
    KeyModifier keymod = new KeyModifier();
    // create a new KeyVersion and add it to the Key
    KeyVersion keyversion = keymod.addKeyVersion();
    // get the primary key version from the Key using the KeyModifier
    KeyVersion primary = keymod.getPrimary();
    // check that the primary key version is equal to the key version we created and added to the
    // Key
    assertEquals(keyversion, primary);
  }
View Full Code Here

Examples of com.google.k2crypto.keyversions.KeyVersion

  public void testAddOneKeyVersionToKey() throws BuilderException, KeyModifierException {
    // create a key modifier
    KeyModifier keymod = new KeyModifier();

    // create and add a KeyVersion and add it to the Key
    KeyVersion keyversion1 = keymod.addKeyVersion();

    // create and add another KeyVersion and add it to the Key
    KeyVersion keyversion2 = keymod.addKeyVersion();
   
    // Set the second key version as primary
    keymod.setPrimary(keyversion2);
   
    // remove the first keyversion from the key
View Full Code Here

Examples of com.google.k2crypto.keyversions.KeyVersion

  public void testRemoveKeyVersionToKey() throws BuilderException, KeyModifierException {
    // create a key modifier
    KeyModifier keymod = new KeyModifier();

    // create and add a KeyVersion and add it to the Key
    KeyVersion keyversion1 = keymod.addKeyVersion();

    // create and add another KeyVersion and add it to the Key
    KeyVersion keyversion2 = keymod.addKeyVersion();

    // now remove the second KeyVersion from the Key
    keymod.removeKeyVersion(keyversion2);

    // now check that it has in fact been removed
View Full Code Here

Examples of com.google.k2crypto.keyversions.KeyVersion

  public void testRemovePrimary() throws BuilderException, KeyModifierException {
    // create a key modifier
    KeyModifier keymod = new KeyModifier();

    // create and add a KeyVersion and add it to the Key
    KeyVersion keyversion = keymod.addKeyVersion();
   
    // now attempt to remove the primary KeyVersion from the Key
    // this SHOULD RAISE AN EXCEPTION
    keymod.removeKeyVersion(keyversion);
  }
View Full Code Here

Examples of com.google.k2crypto.keyversions.KeyVersion

  @Test
  public void setPrimary() throws BuilderException {
    // create a key modifier
    KeyModifier keymod = new KeyModifier();
    // create and add a KeyVersion and add it to the Key
    KeyVersion keyversion1 = keymod.addKeyVersion();

    // set the first keyversion as the primary
    keymod.setPrimary(keyversion1);
   
    // create and add another KeyVersion and add it to the Key
    KeyVersion keyversion2 = keymod.addKeyVersion();

    // check that the primary key version is equal to the key version we created and added to the
    // Key
    assertEquals(keyversion1, keymod.getPrimary());
View Full Code Here

Examples of com.google.k2crypto.keyversions.KeyVersion

        // Type field is required
        throw new InvalidKeyDataException(
            InvalidKeyDataException.Reason.PROTO_PARSE, null);
      }
      try {
        KeyVersion kv = registry.newBuilder(kvData.getType())
            .withData(kvData, protoRegistry).build();
        keyVersions.add(kv);
      } catch (InvalidProtocolBufferException ex) {
        // Throw proto parsing exceptions immediately
        throw new InvalidKeyDataException(
View Full Code Here

Examples of com.google.k2crypto.keyversions.KeyVersion

    KeyData.Builder builder = KeyData.newBuilder();
    builder.setCore(getCore());
    List<KeyVersion> keyVersions = this.keyVersions;
    final int size = keyVersions.size();
    for (int i = 0; i < size; ++i) {
      KeyVersion kv = keyVersions.get(i);
      builder.addKeyVersion(kv.buildData());
      if (kv == primary) {
        builder.setPrimary(i);
      }
    }
    if (size > 0 && !builder.hasPrimary()) {
View Full Code Here

Examples of org.keyczar.KeyVersion

        }
    }

    @Override
    public boolean ensureKeyCreated(GenericKeyczar store) throws KeyczarException {
        KeyVersion primaryVersion = store.getMetadata().findPrimaryVersion();
        if (primaryVersion != null) {
            return false;
        }

        log.info("Creating new KeyCzar key");
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.