Package org.bouncycastle.jcajce.util
Class AnnotatedPrivateKey
- java.lang.Object
-
- org.bouncycastle.jcajce.util.AnnotatedPrivateKey
-
- All Implemented Interfaces:
Serializable
,Key
,PrivateKey
,Destroyable
public class AnnotatedPrivateKey extends Object implements PrivateKey
Wrapper for a private key that carries annotations that can be used for tracking or debugging.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
LABEL
-
Fields inherited from interface java.security.PrivateKey
serialVersionUID
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotatedPrivateKey
addAnnotation(String name, Object annotation)
Return a new annotated key with an additional annotation added to it.boolean
equals(Object o)
String
getAlgorithm()
Object
getAnnotation(String key)
Map<String,Object>
getAnnotations()
byte[]
getEncoded()
String
getFormat()
PrivateKey
getKey()
int
hashCode()
AnnotatedPrivateKey
removeAnnotation(String name)
Return a new annotated key with the named annotation removed.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
-
-
-
Field Detail
-
LABEL
public static final String LABEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getKey
public PrivateKey getKey()
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceKey
-
addAnnotation
public AnnotatedPrivateKey addAnnotation(String name, Object annotation)
Return a new annotated key with an additional annotation added to it.- Parameters:
name
- the name of the annotation to add.annotation
- the object providing the annotation details.- Returns:
- a new annotated key with the extra annotation.
-
removeAnnotation
public AnnotatedPrivateKey removeAnnotation(String name)
Return a new annotated key with the named annotation removed.- Parameters:
name
- the name of the annotation to remove.- Returns:
- a new annotated key with the named annotation removed.
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncoded
in interfaceKey
-
-