@ThreadSafe public class SIVAESBasedPairwiseSubjectCodec extends PairwiseSubjectCodec
The plain text is formatted as follows ('|' as delimiter):
sector_id|local_sub
Related specifications:
CHARSET
Constructor and Description |
---|
SIVAESBasedPairwiseSubjectCodec(SecretKey secretKey)
Creates a new SIV AES - based codec for pairwise subject
identifiers.
|
Modifier and Type | Method and Description |
---|---|
Map.Entry<SectorID,Subject> |
decode(Subject pairwiseSubject)
Decodes the specified pairwise subject identifier to produce the
matching sector identifier and local subject.
|
Subject |
encode(SectorID sectorID,
Subject localSub)
Encodes a new pairwise subject identifier from the specified sector
identifier and local subject.
|
SecretKey |
getSecretKey()
Returns the secret key.
|
encode, getProvider, getSalt, setProvider
public SIVAESBasedPairwiseSubjectCodec(SecretKey secretKey)
secretKey
- A 256, 384, or 512-bit secret key. Must not be
null
.public SecretKey getSecretKey()
public Subject encode(SectorID sectorID, Subject localSub)
PairwiseSubjectCodec
encode
in class PairwiseSubjectCodec
sectorID
- The sector identifier. Must not be
null
.localSub
- The local subject identifier. Must not be
null
.public Map.Entry<SectorID,Subject> decode(Subject pairwiseSubject) throws InvalidPairwiseSubjectException
PairwiseSubjectCodec
UnsupportedOperationException
. Codecs that support pairwise
subject identifier reversal should override this method.decode
in class PairwiseSubjectCodec
pairwiseSubject
- The pairwise subject identifier. Must be
valid and not null
.InvalidPairwiseSubjectException
- If the pairwise subject is
invalid.Copyright © 2018 Connect2id Ltd.. All rights reserved.