类 EncryptionMaterials
- java.lang.Object
-
- com.tencent.cos.xml.crypto.EncryptionMaterials
-
- 所有已实现的接口:
java.io.Serializable
- 直接已知子类:
KMSEncryptionMaterials
public class EncryptionMaterials extends java.lang.Object implements java.io.SerializableThe "key encrypting key" materials used in encrypt/decryption. These materials may be either an asymmetric key pair or a symmetric key but not both.- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 限定符 构造器 说明 EncryptionMaterials(java.security.KeyPair keyPair)Constructs a new EncryptionMaterials object, storing an asymmetric key pair.protectedEncryptionMaterials(java.security.KeyPair keyPair, javax.crypto.SecretKey symmetricKey)Base constructor for the EncryptionMaterials object.EncryptionMaterials(javax.crypto.SecretKey symmetricKey)Constructs a new EncryptionMaterials object, storing a symmetric key.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 EncryptionMaterialsaddDescription(java.lang.String name, java.lang.String value)Fluent API to add material description.EncryptionMaterialsaddDescriptions(java.util.Map<java.lang.String,java.lang.String> descriptions)Fluent API to add all the given material descriptions.EncryptionMaterialsAccessorgetAccessor()Returns null since the EncryptionMaterials base class does not have a materials accessor.java.lang.StringgetCustomerMasterKeyId()protected java.lang.StringgetDescription(java.lang.String name)java.security.KeyPairgetKeyPair()Returns the key pair stored in this EncryptionMaterials object.java.util.Map<java.lang.String,java.lang.String>getMaterialsDescription()Returns a snapshot of the current material description; never null.javax.crypto.SecretKeygetSymmetricKey()Returns the symmetric key stored in this EncryptionMaterials object.booleanisKMSEnabled()Returns true if this is a KMS material description; false otherwise.
-
-
-
构造器详细资料
-
EncryptionMaterials
public EncryptionMaterials(java.security.KeyPair keyPair)
Constructs a new EncryptionMaterials object, storing an asymmetric key pair.- 参数:
keyPair- The asymmetric key pair to be stored in this EncryptionMaterials object.
-
EncryptionMaterials
public EncryptionMaterials(javax.crypto.SecretKey symmetricKey)
Constructs a new EncryptionMaterials object, storing a symmetric key.- 参数:
symmetricKey- The symmetric key to be stored in this EncryptionMaterials object.
-
EncryptionMaterials
protected EncryptionMaterials(java.security.KeyPair keyPair, javax.crypto.SecretKey symmetricKey)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.
-
-
方法详细资料
-
getKeyPair
public java.security.KeyPair getKeyPair()
Returns the key pair stored in this EncryptionMaterials object.- 返回:
- the key pair stored in this EncryptionMaterials object.
-
getSymmetricKey
public javax.crypto.SecretKey getSymmetricKey()
Returns the symmetric key stored in this EncryptionMaterials object.- 返回:
- the symmetric key stored in this EncryptionMaterials object.
-
getMaterialsDescription
public java.util.Map<java.lang.String,java.lang.String> getMaterialsDescription()
Returns a snapshot of the current material description; never null.
-
getAccessor
public EncryptionMaterialsAccessor getAccessor()
Returns null since the EncryptionMaterials base class does not have a materials accessor. Subclasses may override this method.- 返回:
- null
-
addDescription
public EncryptionMaterials addDescription(java.lang.String name, java.lang.String value)
Fluent API to add material description.
-
addDescriptions
public EncryptionMaterials addDescriptions(java.util.Map<java.lang.String,java.lang.String> descriptions)
Fluent API to add all the given material descriptions.
-
isKMSEnabled
public boolean isKMSEnabled()
Returns true if this is a KMS material description; false otherwise.- 返回:
- false by default
-
getCustomerMasterKeyId
public java.lang.String getCustomerMasterKeyId()
- 抛出:
java.lang.UnsupportedOperationException- by default
-
getDescription
protected java.lang.String getDescription(java.lang.String name)
-
-