Package com.google.k2crypto.KeyProto

Examples of com.google.k2crypto.KeyProto.KeyData


   *
   * @throws StoreIOException if there is an error serializing the key.
   */
  private static byte[] serializeKey(Key key) throws StoreIOException {
    try {
      KeyData data = key.buildData().build();
      byte[] bytes = new byte[data.getSerializedSize()];
      CodedOutputStream cos = CodedOutputStream.newInstance(bytes);
      data.writeTo(cos);
      cos.checkNoSpaceLeft();
      return bytes;
    } catch (Exception ex) {
      throw new StoreIOException(
          StoreIOException.Reason.SERIALIZATION_ERROR, ex);
View Full Code Here


  /**
   * @see WritableDriver#save(Key)
   */
  public void save(Key key) throws StoreException {
    KeyData data;
    try {
      data = key.buildData().build();
    } catch (RuntimeException ex) {
      throw new StoreIOException(
          StoreIOException.Reason.SERIALIZATION_ERROR, ex);
View Full Code Here

 
  /**
   * @see ReadableDriver#load()
   */
  public Key load() throws StoreException {
    KeyData data = memSpace.load(address);
    if (data == null) {
      return null;
    }
    try {
      return new Key(context, data);
View Full Code Here

TOP

Related Classes of com.google.k2crypto.KeyProto.KeyData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.