be.fgov.ehealth.etee.crypto.encrypt

## Class EncryptionTokenFactory

- java.lang.Object
- - be.fgov.ehealth.etee.crypto.encrypt.EncryptionTokenFactory

-     public final class EncryptionTokenFactory
      extends java.lang.Object

  Factory to create EncryptionTokens.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EncryptionToken` | `create(byte[] encryptionTokenKeyBytes)` Creates an EncryptionToken from ETK encoded bytes.
    `EncryptionToken` | `create(java.io.File encryptionTokenFile)`
    `EncryptionToken` | `create(java.io.InputStream encryptionTokenStream)`
    `EncryptionToken` | `create(java.lang.String encryptionTokenBase64)`
    `static EncryptionTokenFactory` | `getInstance()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static EncryptionTokenFactory getInstance()

      Returns:
        an instance of the singleton factory.

    - #### create

          public EncryptionToken create(java.io.File encryptionTokenFile)
                                 throws java.io.FileNotFoundException,
                                        java.security.GeneralSecurityException

      Throws:
        `java.io.FileNotFoundException`
        `java.security.GeneralSecurityException`
      See Also:
        `create(byte[])`

    - #### create

          public EncryptionToken create(java.io.InputStream encryptionTokenStream)
                                 throws java.security.GeneralSecurityException

      Throws:
        `java.security.GeneralSecurityException`
      See Also:
        `create(byte[])`

    - #### create

          public EncryptionToken create(java.lang.String encryptionTokenBase64)
                                 throws java.security.GeneralSecurityException

      Throws:
        `java.security.GeneralSecurityException`
      See Also:
        `create(byte[])`

    - #### create

          public EncryptionToken create(byte[] encryptionTokenKeyBytes)
                                 throws java.security.GeneralSecurityException

      Creates an EncryptionToken from ETK encoded bytes.
      Parameters:
        `encryptionTokenKeyBytes` - the ETK encoded bytes.
      Throws:
        `java.security.GeneralSecurityException` - When the encryption token could not be created with the given ETK encoded bytes

Copyright © 2021 eHealth. All rights reserved.