Class KTSParameterSpec.Builder

  • Enclosing class:
    KTSParameterSpec

    public static final class KTSParameterSpec.Builder
    extends java.lang.Object
    Builder class for creating a KTSParameterSpec.
    • Constructor Detail

      • Builder

        public Builder​(java.lang.String algorithmName,
                       int keySizeInBits)
        Basic builder.
        Parameters:
        algorithmName - the algorithm name for the secret key we use for wrapping.
        keySizeInBits - the size of the wrapping key we want to produce in bits.
      • Builder

        public Builder​(java.lang.String algorithmName,
                       int keySizeInBits,
                       byte[] otherInfo)
        Basic builder.
        Parameters:
        algorithmName - the algorithm name for the secret key we use for wrapping.
        keySizeInBits - the size of the wrapping key we want to produce in bits.
        otherInfo - the otherInfo/IV encoding to be applied to the KDF.
    • Method Detail

      • withParameterSpec

        public KTSParameterSpec.Builder withParameterSpec​(java.security.spec.AlgorithmParameterSpec parameterSpec)
        Set the algorithm parameter spec to be used with the wrapper.
        Parameters:
        parameterSpec - the algorithm parameter spec to be used in wrapping/unwrapping.
        Returns:
        the current Builder instance.
      • withKdfAlgorithm

        public KTSParameterSpec.Builder withKdfAlgorithm​(AlgorithmIdentifier kdfAlgorithm)
        Set the KDF algorithm and digest algorithm for wrap key generation.
        Parameters:
        kdfAlgorithm - the KDF algorithm to apply.
        Returns:
        the current Builder instance.
      • build

        public KTSParameterSpec build()
        Build the new parameter spec.
        Returns:
        a new parameter spec configured according to the builder state.