Package jenkins.security
Class CryptoConfidentialKey
- java.lang.Object
-
- jenkins.security.ConfidentialKey
-
- jenkins.security.CryptoConfidentialKey
-
public class CryptoConfidentialKey extends ConfidentialKey
ConfidentialKeythat stores aSecretKeyfor shared-secret cryptography (AES).- Since:
- 1.498
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_IV_LENGTH
-
Constructor Summary
Constructors Constructor Description CryptoConfidentialKey(Class owner, String shortName)CryptoConfidentialKey(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Cipherdecrypt()Deprecated.usedecrypt(byte[])Cipherdecrypt(byte[] iv)Returns aCipherobject for decrypting with this key using the provided initialization vector.Cipherencrypt()Deprecated.useencrypt(byte[])Cipherencrypt(byte[] iv)Returns aCipherobject for encrypting with this key using the provided initialization vector.byte[]newIv()Generates a new Initialization Vector of default length.byte[]newIv(int length)Generates a new Initialization Vector.-
Methods inherited from class jenkins.security.ConfidentialKey
getId, load, store
-
-
-
-
Field Detail
-
DEFAULT_IV_LENGTH
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final int DEFAULT_IV_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
encrypt
@Deprecated public Cipher encrypt()
Deprecated.useencrypt(byte[])Returns aCipherobject for encrypting with this key.
-
encrypt
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Cipher encrypt(byte[] iv)
Returns aCipherobject for encrypting with this key using the provided initialization vector.- Parameters:
iv- the initialization vector- Returns:
- the cipher
-
decrypt
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Cipher decrypt(byte[] iv)
Returns aCipherobject for decrypting with this key using the provided initialization vector.- Parameters:
iv- the initialization vector- Returns:
- the cipher
-
newIv
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public byte[] newIv(int length)
Generates a new Initialization Vector.- Parameters:
length- the length of the salt- Returns:
- some random bytes
- See Also:
encrypt(byte[])
-
newIv
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public byte[] newIv()
Generates a new Initialization Vector of default length.- Returns:
- some random bytes
- See Also:
newIv(int),encrypt(byte[])
-
decrypt
@Deprecated public Cipher decrypt()
Deprecated.usedecrypt(byte[])Returns aCipherobject for decrypting with this key.
-
-