Class CryptoConfidentialKey

java.lang.Object
jenkins.security.ConfidentialKey
jenkins.security.CryptoConfidentialKey

public class CryptoConfidentialKey extends ConfidentialKey
ConfidentialKey that stores a SecretKey for shared-secret cryptography (AES).
Since:
1.498
Author:
Kohsuke Kawaguchi
  • Field Details

    • DEFAULT_IV_LENGTH

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final int DEFAULT_IV_LENGTH
      See Also:
  • Constructor Details

    • CryptoConfidentialKey

      public CryptoConfidentialKey(String id)
    • CryptoConfidentialKey

      public CryptoConfidentialKey(Class owner, String shortName)
  • Method Details

    • encrypt

      @Deprecated public Cipher encrypt()
      Deprecated.
      Returns a Cipher object for encrypting with this key.
    • encrypt

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Cipher encrypt(byte[] iv)
      Returns a Cipher 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 a Cipher 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:
    • 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:
    • decrypt

      @Deprecated public Cipher decrypt()
      Deprecated.
      Returns a Cipher object for decrypting with this key.