org.apache.hadoop.crypto.key
Class KeyProvider.Metadata

java.lang.Object
  extended by org.apache.hadoop.crypto.key.KeyProvider.Metadata
Direct Known Subclasses:
KMSClientProvider.KMSMetadata
Enclosing class:
KeyProvider

public static class KeyProvider.Metadata
extends Object

Key metadata that is associated with the key.


Constructor Summary
protected KeyProvider.Metadata(byte[] bytes)
          Deserialize a new metadata object from a set of bytes.
protected KeyProvider.Metadata(String cipher, int bitLength, String description, Map<String,String> attributes, Date created, int versions)
           
 
Method Summary
protected  int addVersion()
           
 String getAlgorithm()
          Get the algorithm from the cipher.
 Map<String,String> getAttributes()
           
 int getBitLength()
           
 String getCipher()
           
 Date getCreated()
           
 String getDescription()
           
 int getVersions()
           
protected  byte[] serialize()
          Serialize the metadata to a set of bytes.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyProvider.Metadata

protected KeyProvider.Metadata(String cipher,
                               int bitLength,
                               String description,
                               Map<String,String> attributes,
                               Date created,
                               int versions)

KeyProvider.Metadata

protected KeyProvider.Metadata(byte[] bytes)
                        throws IOException
Deserialize a new metadata object from a set of bytes.

Parameters:
bytes - the serialized metadata
Throws:
IOException
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getDescription

public String getDescription()

getCreated

public Date getCreated()

getCipher

public String getCipher()

getAttributes

public Map<String,String> getAttributes()

getAlgorithm

public String getAlgorithm()
Get the algorithm from the cipher.

Returns:
the algorithm name

getBitLength

public int getBitLength()

getVersions

public int getVersions()

addVersion

protected int addVersion()

serialize

protected byte[] serialize()
                    throws IOException
Serialize the metadata to a set of bytes.

Returns:
the serialized bytes
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.