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:
  • Field Details

  • Method Details

    • getKey

      public PrivateKey getKey()
    • getAnnotations

      public Map<String,Object> getAnnotations()
    • getAlgorithm

      public String getAlgorithm()
      Specified by:
      getAlgorithm in interface Key
    • getAnnotation

      public Object getAnnotation(String key)
    • 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.
    • getFormat

      public String getFormat()
      Specified by:
      getFormat in interface Key
    • getEncoded

      public byte[] getEncoded()
      Specified by:
      getEncoded in interface Key
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object