Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2010-20154 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;
KMS specific encryption materials.

The KEK has no relevance on the client-side, as KMS only requires the CMK id to be used to uniquely identify the KEK on the server side.

public class KMSEncryptionMaterials extends EncryptionMaterials {
    
Name of the materail description to be persisted in S3 for the KMS's customer master key id.
    public static final String CUSTOMER_MASTER_KEY_ID = "kms_cmk_id"
    

Parameters:
defaultCustomerMasterKeyId KMS's customer master key id; must not be null
    public KMSEncryptionMaterials(String defaultCustomerMasterKeyId) {
        super(nullnull);
        if (defaultCustomerMasterKeyId == null
                || defaultCustomerMasterKeyId.length() == 0)
            throw new IllegalArgumentException(
                    "The default customer master key id must be specified");
        addDescription(defaultCustomerMasterKeyId);
    }

    
Always throws UnsupportedOperationException.
    @Override
    public final KeyPair getKeyPair() {
        throw new UnsupportedOperationException();
    }

    
Always throws UnsupportedOperationException.
    @Override
    public final SecretKey getSymmetricKey() {
        throw new UnsupportedOperationException();
    }

    
Always returns true.

Returns:
true
    @Override
    public final boolean isKMSEnabled() {
        return true;
    }

    
Returns the default KMS's Customer Master Key ID; or null if there isn't one.
    @Override
    public String getCustomerMasterKeyId() {
        return getDescription();
    }
    @Override
    public String toString() {
        return String.valueOf(getMaterialsDescription());
    }
New to GrepCode? Check out our FAQ X