Class UserPublicKey
java.lang.Object
com.illumon.iris.db.v2.permissions.rs.records.UserPublicKey
A Public key wrapper entity, to manage storage of user public keys in the acl database
-
Constructor Summary
ConstructorsConstructorDescriptionRequired default constructor to support auto conversion to jsonConstructor that takes individual properties ofPublicKey
UserPublicKey
(String user, PublicKey publicKey) Constructor that takes an instance ofPublicKey
-
Method Summary
Modifier and TypeMethodDescriptionReturns the Command details for addPublicKeyForUser, used in audit event log.Returns the Command details for deletePublicKeyForUser, used in audit event log.Returns string used as prefix while logging for addPublicKeyForUser.getUser()
Returns the public key by decoding and regenerating it using the attributes from the entityvoid
setAlgorithm
(String algorithm) void
setComment
(String comment) void
setEncodedStr
(String encodedStr) void
setProvider
(String provider) void
toString()
-
Constructor Details
-
UserPublicKey
public UserPublicKey()Required default constructor to support auto conversion to json -
UserPublicKey
public UserPublicKey(@NotNull String user, @NotNull String encodedStr, @NotNull String algorithm, @Nullable String provider, @Nullable String comment) Constructor that takes individual properties ofPublicKey
- Parameters:
user
- user who is mapped to public key, this is expected to come from key fileencodedStr
- The encoded public key from key filealgorithm
- The algorithm used to encode example (DSA, RSA)provider
- Optional provider used to encode / decode the key file, if null Default provider will be usedcomment
- Optional comment to include when the key is inserted in acl db
-
UserPublicKey
Constructor that takes an instance ofPublicKey
- Parameters:
user
- user who is mapped to public key, this is expected to come from key filepublicKey
- The public key to store
-
-
Method Details
-
getComment
-
setComment
-
getUser
-
setUser
-
getEncodedStr
-
setEncodedStr
-
getAlgorithm
-
setAlgorithm
-
getProvider
-
setProvider
-
publicKey
public PublicKey publicKey() throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecExceptionReturns the public key by decoding and regenerating it using the attributes from the entity- Returns:
- the regenerated public key
- Throws:
NoSuchAlgorithmException
- when the algorithm provided is null or doesn't match the algorithm used in original encodingNoSuchProviderException
- if provider doesn't match the provider used in original encodingInvalidKeySpecException
- when encoded key fails key specifications validations
-
detailsPrefix
Returns string used as prefix while logging for addPublicKeyForUser. The prefix is constructed using theuser
andcomment
attributes- Returns:
- prefix while logging for addPublicKeyForUser
-
addDetailsString
Returns the Command details for addPublicKeyForUser, used in audit event log. Constructed usinguser
,comment
and abbreviated public key- Returns:
- command details for addPublicKeyForUser.
-
deleteDetailsString
Returns the Command details for deletePublicKeyForUser, used in audit event log. Constructed using abbreviated public key- Returns:
- command details for deletePublicKeyForUser.
-
toString
-