Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *  http://aws.amazon.com/apache2.0
   *
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.s3.model;
 
 import java.util.Map;
 
The "key encrypting key" materials used in encrypt/decryption. These materials may be either an asymmetric key pair or a symmetric key but not both.
 
 public class EncryptionMaterials {
     private final KeyPair keyPair;
     private final SecretKey symmetricKey;
     private final Map<StringStringdesc = new HashMap<String,String>();

    
Constructs a new EncryptionMaterials object, storing an asymmetric key pair.

Parameters:
keyPair The asymmetric key pair to be stored in this EncryptionMaterials object.
 
     public EncryptionMaterials(KeyPair keyPair) {
         this(keyPairnull);
     }

    
Constructs a new EncryptionMaterials object, storing a symmetric key.

Parameters:
symmetricKey The symmetric key to be stored in this EncryptionMaterials object.
 
     public EncryptionMaterials(SecretKey symmetricKey) {
         this(nullsymmetricKey);
     }

    
Base constructor for the EncryptionMaterials object. This is not publicly visible since it should not be possible to create an EncryptionMaterials object that contains both an asymmetric key pair and a symmetric key.
 
     protected EncryptionMaterials(KeyPair keyPairSecretKey symmetricKey) {
         this. = keyPair;        
         this. = symmetricKey;
     }

    
Returns the key pair stored in this EncryptionMaterials object.

Returns:
the key pair stored in this EncryptionMaterials object.
 
     public KeyPair getKeyPair() {
         return this.;
     }    

    
Returns the symmetric key stored in this EncryptionMaterials object.

Returns:
the symmetric key stored in this EncryptionMaterials object.
 
     public SecretKey getSymmetricKey() {
         return this.;
     }

    
Returns a snapshot of the current material description; never null.
 
     public Map<StringStringgetMaterialsDescription() {
         return new HashMap<StringString>();
     }

    
Returns null since the EncryptionMaterials base class does not have a materials accessor. Subclasses may override this method.

Returns:
null
 
         return null;
     }

    
Fluent API to add material description.
    public EncryptionMaterials addDescription(String nameString value) {
        .put(namevalue);
        return this;
    }

    
Fluent API to add all the given material descriptions.
    public EncryptionMaterials addDescriptions(Map<String,Stringdescriptions) {
        .putAll(descriptions);
        return this;
    }

    
Returns true if this is a KMS material description; false otherwise.

Returns:
false by default
    public boolean isKMSEnabled() {
        return false;
    }

    
    public String getCustomerMasterKeyId() {
        throw new UnsupportedOperationException();
    }
    
    protected String getDescription(String name) {
        return .get(name);
    }
New to GrepCode? Check out our FAQ X