To generate secrete key we can use Java KeyGenerator class which provides the functionality of a secret (symmetric) key generator. Key generators are constructed using one of the getInstance class methods of this class. GetInstance method of KeyGenerator takes parameter name of algorithm and Returns a KeyGenerator object that generates secret keys for the specified algorithm. This method traverses the list of registered security Providers, starting with the most preferred Provider. Djecrety is a Django secret key generator. This is a web tool to generate SECRETKEY and also have a Django package that does this simply with a command. Djecrety Django Secret Key Generator.
- Jan 22, 2020 Get started with Office 365 Management APIs. 1/22/2020; 14 minutes to read; In this article. When you create an application that needs access to secured services like the Office 365 Management APIs, you need to provide a way to let the service know if.
- An encryption context is a collection of non-secret key-value pairs that represents additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data.
- To generate a key, you need a KeyFactory or SecretKeyFactory. SecretKeyFactory factory = SecretKeyFactory.getInstance(algorithm); and then to generate a secret. Factory.generateSecret(keySpec); given a key spec that is appropriate to the algorithm. See the KeySpec javadoc for pointers to algorithm specific KeySpec implementations.
![Secret Key Generate Java Docs Secret Key Generate Java Docs](https://docs.oracle.com/javase/8/docs/technotes/guides/security/images/jca/KeyFactory.gif)
JavaScript is disabled on your browser.
- Class
Did this page help you?
Class GenerateDataKeyPairWithoutPlaintextRequest
-
-
- com.amazonaws.services.kms.model.GenerateDataKeyPairWithoutPlaintextRequest
-
-
- All Implemented Interfaces:
- HandlerContextAware, ReadLimitInfo, Serializable, Cloneable
- See Also:
- AWS API Documentation, Serialized Form
-
-
Field Summary
-
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
-
Constructor Summary
Constructors Constructor and Description GenerateDataKeyPairWithoutPlaintextRequest()
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description GenerateDataKeyPairWithoutPlaintextRequest
addEncryptionContextEntry(String key, String value)
GenerateDataKeyPairWithoutPlaintextRequest
clearEncryptionContextEntries()
Removes all the entries added into EncryptionContext.GenerateDataKeyPairWithoutPlaintextRequest
clone()
Creates a shallow clone of this object for all fields except the handler context.boolean
equals(Object obj)
Map<String,String>
getEncryptionContext()
Specifies the encryption context that will be used when encrypting the private key in the data key pair.List<String>
getGrantTokens()
String
getKeyId()
Specifies the CMK that encrypts the private key in the data key pair.String
getKeyPairSpec()
Determines the type of data key pair that is generated.int
hashCode()
void
setEncryptionContext(Map<String,String> encryptionContext)
Specifies the encryption context that will be used when encrypting the private key in the data key pair.void
setGrantTokens(Collection<String> grantTokens)
void
setKeyId(String keyId)
Specifies the CMK that encrypts the private key in the data key pair.void
setKeyPairSpec(String keyPairSpec)
Determines the type of data key pair that is generated.String
toString()
GenerateDataKeyPairWithoutPlaintextRequest
withEncryptionContext(Map<String,String> encryptionContext)
Specifies the encryption context that will be used when encrypting the private key in the data key pair.GenerateDataKeyPairWithoutPlaintextRequest
withGrantTokens(Collection<String> grantTokens)
GenerateDataKeyPairWithoutPlaintextRequest
withGrantTokens(String... grantTokens)
A list of grant tokens.GenerateDataKeyPairWithoutPlaintextRequest
withKeyId(String keyId)
Specifies the CMK that encrypts the private key in the data key pair.GenerateDataKeyPairWithoutPlaintextRequest
withKeyPairSpec(DataKeyPairSpec keyPairSpec)
Determines the type of data key pair that is generated.GenerateDataKeyPairWithoutPlaintextRequest
withKeyPairSpec(String keyPairSpec)
Determines the type of data key pair that is generated.-
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
addHandlerContext, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getHandlerContext, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestCredentialsProvider, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
GenerateDataKeyPairWithoutPlaintextRequest
-
-
Method Detail
-
getEncryptionContext
Specifies the encryption context that will be used when encrypting the private key in the data key pair.An encryption context is a collection of non-secret key-value pairs that represents additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is optional when encrypting with a symmetric CMK, but it is highly recommended.For more information, see Encryption Context in the AWS Key Management Service Developer Guide.- Returns:
-
Specifies the encryption context that will be used when encrypting the private key in the data key pair.
An encryption context is a collection of non-secret key-value pairs that represents additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is optional when encrypting with a symmetric CMK, but it is highly recommended.For more information, see Encryption Context in the AWS Key Management Service Developer Guide.
-
setEncryptionContext
Specifies the encryption context that will be used when encrypting the private key in the data key pair.An encryption context is a collection of non-secret key-value pairs that represents additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is optional when encrypting with a symmetric CMK, but it is highly recommended.For more information, see Encryption Context in the AWS Key Management Service Developer Guide.- Parameters:
-
encryptionContext
- Specifies the encryption context that will be used when encrypting the private key in the data key pair.An encryption context is a collection of non-secret key-value pairs that represents additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is optional when encrypting with a symmetric CMK, but it is highly recommended.For more information, see Encryption Context in the AWS Key Management Service Developer Guide.
-
withEncryptionContext
Specifies the encryption context that will be used when encrypting the private key in the data key pair.An encryption context is a collection of non-secret key-value pairs that represents additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is optional when encrypting with a symmetric CMK, but it is highly recommended.For more information, see Encryption Context in the AWS Key Management Service Developer Guide.- Parameters:
-
encryptionContext
- Specifies the encryption context that will be used when encrypting the private key in the data key pair.An encryption context is a collection of non-secret key-value pairs that represents additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is optional when encrypting with a symmetric CMK, but it is highly recommended.For more information, see Encryption Context in the AWS Key Management Service Developer Guide. - Returns:
- Returns a reference to this object so that method calls can be chained together.
-
addEncryptionContextEntry
- See Also:
withEncryptionContext(java.util.Map<java.lang.String, java.lang.String>)
-
clearEncryptionContextEntries
Removes all the entries added into EncryptionContext.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setKeyId
Specifies the CMK that encrypts the private key in the data key pair. You must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the type of your CMK, use the DescribeKey operation.To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with'alias/'
.For example:-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.- Parameters:
-
keyId
- Specifies the CMK that encrypts the private key in the data key pair. You must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the type of your CMK, use the DescribeKey operation.To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with'alias/'
.For example:-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases. -
-
-
getKeyId
Specifies the CMK that encrypts the private key in the data key pair. You must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the type of your CMK, use the DescribeKey operation.To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with'alias/'
.For example:-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.- Returns:
-
Specifies the CMK that encrypts the private key in the data key pair. You must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the type of your CMK, use the DescribeKey operation.
To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with
'alias/'
.For example:-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases. -
-
-
withKeyId
Specifies the CMK that encrypts the private key in the data key pair. You must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the type of your CMK, use the DescribeKey operation.To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with'alias/'
.For example:-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.- Parameters:
-
keyId
- Specifies the CMK that encrypts the private key in the data key pair. You must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the type of your CMK, use the DescribeKey operation.To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with'alias/'
.For example:-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases. -
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
setKeyPairSpec
Determines the type of data key pair that is generated.The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS.- Parameters:
-
keyPairSpec
- Determines the type of data key pair that is generated.The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS. - See Also:
DataKeyPairSpec
-
getKeyPairSpec
Determines the type of data key pair that is generated.The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS.- Returns:
-
Determines the type of data key pair that is generated.
The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS.
- See Also:
DataKeyPairSpec
-
withKeyPairSpec
Determines the type of data key pair that is generated.The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS.- Parameters:
-
keyPairSpec
- Determines the type of data key pair that is generated.The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS. - Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
DataKeyPairSpec
-
withKeyPairSpec
Determines the type of data key pair that is generated.The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS.- Parameters:
-
keyPairSpec
- Determines the type of data key pair that is generated.The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt and decrypt or to sign and verify (but not both), and the rule that permits you to use ECC CMKs only to sign and verify, are not effective outside of AWS KMS. - Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
DataKeyPairSpec
-
getGrantTokens
A list of grant tokens.For more information, see Grant Tokens in the AWS Key Management Service Developer Guide.- Returns:
-
A list of grant tokens.
For more information, see Grant Tokens in the AWS Key Management Service Developer Guide.
-
setGrantTokens
A list of grant tokens.For more information, see Grant Tokens in the AWS Key Management Service Developer Guide.- Parameters:
-
grantTokens
- A list of grant tokens.For more information, see Grant Tokens in the AWS Key Management Service Developer Guide.
-
withGrantTokens
A list of grant tokens.For more information, see Grant Tokens in the AWS Key Management Service Developer Guide.NOTE: This method appends the values to the existing list (if any). UsesetGrantTokens(java.util.Collection)
orwithGrantTokens(java.util.Collection)
if you want to override the existing values.- Parameters:
-
grantTokens
- A list of grant tokens.For more information, see Grant Tokens in the AWS Key Management Service Developer Guide. - Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withGrantTokens
A list of grant tokens.For more information, see Grant Tokens in the AWS Key Management Service Developer Guide.- Parameters:
-
grantTokens
- A list of grant tokens.For more information, see Grant Tokens in the AWS Key Management Service Developer Guide. - Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
equals
- Overrides:
equals
in classObject
-
hashCode
- Overrides:
hashCode
in classObject
-
clone
Description copied from class:AmazonWebServiceRequest
Creates a shallow clone of this object for all fields except the handler context. Explicitly does not clone the deep structure of the other fields in the message.- Overrides:
clone
in classAmazonWebServiceRequest
- See Also:
Object.clone()
-
-
- Class
Free Keygens Downloads
- Summary:
- Nested |
- Field |
- Constr |
- Detail:
- Field |
- Constr |
Secret Key Generate Java Docs 2017
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.