@Component public class KeymanagerUtil extends Object
| Constructor and Description |
|---|
KeymanagerUtil() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decryptKey(byte[] key,
PrivateKey privateKey)
Function to decrypt key
|
byte[] |
encryptKey(PrivateKey privateKey,
PublicKey masterKey)
Function to encrypt key
|
void |
isCertificateValid(CertificateEntry<X509Certificate,PrivateKey> certificateEntry,
Date inputDate) |
boolean |
isOverlapping(java.time.LocalDateTime timeStamp,
java.time.LocalDateTime policyExpiryTime,
java.time.LocalDateTime keyGenerationTime,
java.time.LocalDateTime keyExpiryTime)
Function to check if timestamp is overlapping
|
boolean |
isValidReferenceId(String referenceId)
Function to check is reference id is valid
|
boolean |
isValidTimestamp(java.time.LocalDateTime timeStamp,
KeyAlias keyAlias)
Function to check valid timestamp
|
java.time.LocalDateTime |
parseToLocalDateTime(String dateTime)
Parse a date string of pattern UTC_DATETIME_PATTERN into
LocalDateTime |
PrivateKey |
privateKeyExtractor(InputStream privateKeyInputStream) |
<T extends BaseEntity> |
setMetaData(T entity)
Function to set metadata
|
public boolean isValidTimestamp(java.time.LocalDateTime timeStamp,
KeyAlias keyAlias)
timeStamp - timeStampkeyAlias - keyAliaspublic boolean isOverlapping(java.time.LocalDateTime timeStamp,
java.time.LocalDateTime policyExpiryTime,
java.time.LocalDateTime keyGenerationTime,
java.time.LocalDateTime keyExpiryTime)
timeStamp - timeStamppolicyExpiryTime - policyExpiryTimekeyGenerationTime - keyGenerationTimekeyExpiryTime - keyExpiryTimepublic boolean isValidReferenceId(String referenceId)
referenceId - referenceIdpublic <T extends BaseEntity> T setMetaData(T entity)
T - is a type parameterentity - entity of T typepublic byte[] encryptKey(PrivateKey privateKey, PublicKey masterKey)
privateKey - privateKeymasterKey - masterKeypublic byte[] decryptKey(byte[] key,
PrivateKey privateKey)
key - keyprivateKey - privateKeypublic java.time.LocalDateTime parseToLocalDateTime(String dateTime)
LocalDateTimedateTime - of type String of pattern UTC_DATETIME_PATTERNLocalDateTime of given patternpublic void isCertificateValid(CertificateEntry<X509Certificate,PrivateKey> certificateEntry, Date inputDate)
public PrivateKey privateKeyExtractor(InputStream privateKeyInputStream)
Copyright © 2020. All rights reserved.