Class CryptoConfidentialKey

    • Field Detail

      • DEFAULT_IV_LENGTH

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

      • CryptoConfidentialKey

        public CryptoConfidentialKey​(String id)
      • CryptoConfidentialKey

        public CryptoConfidentialKey​(Class owner,
                                     String shortName)
    • Method Detail

      • 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:
        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[])