Class SealdSSKSPasswordPlugin

  • All Implemented Interfaces:

    
    public final class SealdSSKSPasswordPlugin
    
                        

    The SealdSSKSPassword class allows to use the SSKS key storage service to store Seald identities easily and securely, encrypted by a user password.

    • Constructor Detail

      • SealdSSKSPasswordPlugin

        SealdSSKSPasswordPlugin(String ssksURL, String appId, String instanceName, Byte logLevel, Boolean logNoColor)
        Parameters:
        ssksURL - The SSKS server for this instance to use.
        appId - The ID given by the Seald server to your app.
        instanceName - An arbitrary name to give to this Seald instance.
        logLevel - The minimum level of logs you want.
        logNoColor - Should be set to false if you want to enable colors in the log output.
    • Method Detail

      • saveIdentityFromPassword

         final String saveIdentityFromPassword(String userId, String password, ByteArray identity)

        Save the given identity for the given userId, encrypted with the given password.

        Parameters:
        userId - The ID of the userId.
        password - The password to encrypt the key.
        identity - The identity to save.
      • saveIdentityFromPasswordAsync

         final String saveIdentityFromPasswordAsync(String userId, String password, ByteArray identity)

        Save the given identity for the given userId, encrypted with the given password.

        Parameters:
        userId - The ID of the userId.
        password - The password to encrypt the key.
        identity - The identity to save.
      • saveIdentityFromRawKeys

         final String saveIdentityFromRawKeys(String userId, String rawStorageKey, ByteArray rawEncryptionKey, ByteArray identity)

        Save the given identity for the given userId, encrypted with the given raw keys.

        Parameters:
        userId - The ID of the userId.
        rawStorageKey - The key under which identity keys are stored.
        rawEncryptionKey - The raw encryption key used to encrypt / decrypt the stored identity keys.
        identity - The identity to save.
      • saveIdentityFromRawKeysAsync

         final String saveIdentityFromRawKeysAsync(String userId, String rawStorageKey, ByteArray rawEncryptionKey, ByteArray identity)

        Save the given identity for the given userId, encrypted with the given raw keys.

        Parameters:
        userId - The ID of the userId.
        rawStorageKey - The key under which identity keys are stored.
        rawEncryptionKey - The raw encryption key used to encrypt / decrypt the stored identity keys.
        identity - The identity to save.
      • retrieveIdentityFromPassword

         final ByteArray retrieveIdentityFromPassword(String userId, String password)

        Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given password.

        If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.

        Parameters:
        userId - The ID of the userId.
        password - The password to decrypt the key.
      • retrieveIdentityFromPasswordAsync

         final ByteArray retrieveIdentityFromPasswordAsync(String userId, String password)

        Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given password.

        If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.

        Parameters:
        userId - The ID of the userId.
        password - The password to decrypt the key.
      • retrieveIdentityFromRawKeys

         final ByteArray retrieveIdentityFromRawKeys(String userId, String rawStorageKey, ByteArray rawEncryptionKey)

        Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given raw keys.

        If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.

        Parameters:
        userId - The ID of the userId.
        rawStorageKey - The key under which identity keys are stored.
        rawEncryptionKey - The raw encryption key used to encrypt / decrypt the stored identity keys.
      • retrieveIdentityFromRawKeysAsync

         final ByteArray retrieveIdentityFromRawKeysAsync(String userId, String rawStorageKey, ByteArray rawEncryptionKey)

        Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given raw keys.

        If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.

        Parameters:
        userId - The ID of the userId.
        rawStorageKey - The key under which identity keys are stored.
        rawEncryptionKey - The raw encryption key used to encrypt / decrypt the stored identity keys.
      • changeIdentityPassword

         final String changeIdentityPassword(String userId, String currentPassword, String newPassword)

        Change the password use to encrypt the identity for the userId.

        Parameters:
        userId - The ID of the userId.
        currentPassword - The user's current password.
        newPassword - The new password.
      • changeIdentityPasswordAsync

         final String changeIdentityPasswordAsync(String userId, String currentPassword, String newPassword)

        Change the password use to encrypt the identity for the userId.

        Parameters:
        userId - The ID of the userId.
        currentPassword - The user's current password.
        newPassword - The new password.