Package jenkins.security
Class CryptoConfidentialKey
- java.lang.Object
-
- jenkins.security.ConfidentialKey
-
- jenkins.security.CryptoConfidentialKey
-
public class CryptoConfidentialKey extends ConfidentialKey
ConfidentialKey
that stores aSecretKey
for shared-secret cryptography (AES).- Since:
- 1.498
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_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 Cipher
decrypt()
Deprecated.usedecrypt(byte[])
Cipher
decrypt(byte[] iv)
Returns aCipher
object for decrypting with this key using the provided initialization vector.Cipher
encrypt()
Deprecated.useencrypt(byte[])
Cipher
encrypt(byte[] iv)
Returns aCipher
object 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 aCipher
object for encrypting with this key.
-
encrypt
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Cipher encrypt(byte[] iv)
Returns aCipher
object 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 aCipher
object 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 aCipher
object for decrypting with this key.
-
-