public class PublicKeyMapper extends AbstractMapper implements IPublicKeySource
Constructor and Description |
---|
PublicKeyMapper(Session session)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
createOrUpdate(ECPublicKey publicKey,
KeyType type,
int index,
boolean active)
Creates or updates the public key on the Absio Broker™ application.
|
void |
createOrUpdate(IndexedECPublicKey publicKey)
Creates or updates the public key on the Absio Broker™ application.
|
List<IndexedECPublicKey> |
get(UUID userId,
KeyType type,
Integer index)
Gets all public keys matching the user ID, key type, key ring index and algorithm index.
|
IndexedECPublicKey |
getByIndex(UUID userId,
KeyType type,
int index)
This gets the public key that match the user ID, type and index from the Absio Broker™ application.
|
IndexedECPublicKey |
getLatestActive(UUID userId,
KeyType type)
This gets the latest active public key that match the user ID and type from the Absio Broker™ application.
|
getClient, getCredentials, getServerTime, getSession, isAuthenticated, setSession
public PublicKeyMapper(Session session) throws NoSuchAlgorithmException, NoSuchPaddingException
session
- the session for the mapperNoSuchPaddingException
- thrown if the default padding for symmetric encryption is not supportedNoSuchAlgorithmException
- thrown if ECDH is not supportedpublic void createOrUpdate(IndexedECPublicKey publicKey) throws BrokerException, IOException, InterruptedException
publicKey
- the public key to create or updateBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesInterruptedException
- thrown when there is an interruption during rate limitingpublic void createOrUpdate(ECPublicKey publicKey, KeyType type, int index, boolean active) throws BrokerException, IOException, InterruptedException
publicKey
- the public key bytestype
- the KeyType
of keyindex
- the index of the keyactive
- true if the key is activeBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesInterruptedException
- thrown when there is an interruption during rate limitingpublic List<IndexedECPublicKey> get(UUID userId, KeyType type, Integer index) throws BrokerException, IOException, InterruptedException
NOTE: pass in null to ignore a parameter.
userId
- the key owners user's ID or ignored if nulltype
- the key type or ignored if nullindex
- the key index or ignored if nullBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesInterruptedException
- thrown when there is an interruption during rate limitingpublic IndexedECPublicKey getByIndex(UUID userId, KeyType type, int index) throws IllegalArgumentException, BrokerException, IOException, InterruptedException
getByIndex
in interface IPublicKeySource
userId
- the user id of the key ownertype
- the KeyType
of the keyindex
- the index of the keyIndexedECPublicKey
for the user of the specified KeyType
and indexBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesInterruptedException
- thrown when there is an interruption during rate limitingIllegalArgumentException
- thrown if the parameter arguments are incorrectpublic IndexedECPublicKey getLatestActive(UUID userId, KeyType type) throws IllegalArgumentException, BrokerException, IOException, InterruptedException
NOTE: if there is not an active key null will be returned.
getLatestActive
in interface IPublicKeySource
userId
- the user's IDtype
- the KeyType
of public keyKeyType
BrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesInterruptedException
- thrown when there is an interruption during rate limitingIllegalArgumentException
- thrown if the parameter arguments are incorrectCopyright © 2021. All rights reserved.