Package com.yubico.yubikit.piv.jca
Class PivPrivateKey
java.lang.Object
com.yubico.yubikit.piv.jca.PivPrivateKey
- All Implemented Interfaces:
Serializable
,Key
,PrivateKey
,Destroyable
- See Also:
-
Field Summary
Fields inherited from interface java.security.PrivateKey
serialVersionUID
-
Constructor Summary
ModifierConstructorDescriptionprotected
PivPrivateKey
(Slot slot, KeyType keyType, PinPolicy pinPolicy, TouchPolicy touchPolicy, char[] pin) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
byte[]
Get the PIN policy of the key, if available.getSlot()
Get the PIV slot where the private key is stored.Get the Touch policy of the key, if available.boolean
void
setPin
(char[] pin) Sets the PIN to use when performing key operations with this private key, or to null.
-
Field Details
-
pin
@Nullable protected char[] pin
-
-
Constructor Details
-
PivPrivateKey
protected PivPrivateKey(Slot slot, KeyType keyType, @Nullable PinPolicy pinPolicy, @Nullable TouchPolicy touchPolicy, @Nullable char[] pin)
-
-
Method Details
-
getSlot
Get the PIV slot where the private key is stored. -
getPinPolicy
Get the PIN policy of the key, if available. -
getTouchPolicy
Get the Touch policy of the key, if available. -
setPin
public void setPin(@Nullable char[] pin) Sets the PIN to use when performing key operations with this private key, or to null. Note that a copy is made of the PIN, which can be cleared out by callingdestroy()
. -
destroy
public void destroy()- Specified by:
destroy
in interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyed
in interfaceDestroyable
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceKey
-
getFormat
-
getEncoded
@Nullable public byte[] getEncoded()- Specified by:
getEncoded
in interfaceKey
-