Class AesGcmFactory

  • All Implemented Interfaces:
    AeadFactory

    @Immutable
    public final class AesGcmFactory
    extends java.lang.Object
    implements AeadFactory
    An AeadFactory that creates new instances of AES-GCM from raw keys
    • Constructor Summary

      Constructors 
      Constructor Description
      AesGcmFactory​(int keySizeInBytes)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Aead createAead​(byte[] symmetricKey)
      Creates a new Aead-primitive that uses the key material given in symmetricKey, which must be of length AeadFactory.getKeySizeInBytes().
      int getKeySizeInBytes()
      Returns the size of the AEAD key in bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AesGcmFactory

        public AesGcmFactory​(int keySizeInBytes)
                      throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
    • Method Detail

      • getKeySizeInBytes

        public int getKeySizeInBytes()
        Description copied from interface: AeadFactory
        Returns the size of the AEAD key in bytes.
        Specified by:
        getKeySizeInBytes in interface AeadFactory
      • createAead

        public Aead createAead​(byte[] symmetricKey)
                        throws java.security.GeneralSecurityException
        Description copied from interface: AeadFactory
        Creates a new Aead-primitive that uses the key material given in symmetricKey, which must be of length AeadFactory.getKeySizeInBytes().
        Specified by:
        createAead in interface AeadFactory
        Returns:
        the newly created Aead-primitive.
        Throws:
        java.security.GeneralSecurityException