org.bitcoinj.wallet
Class Protos.Key

java.lang.Object
  extended by com.google.protobuf.AbstractMessageLite
      extended by com.google.protobuf.AbstractMessage
          extended by com.google.protobuf.GeneratedMessage
              extended by org.bitcoinj.wallet.Protos.Key
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable, Protos.KeyOrBuilder
Enclosing class:
Protos

public static final class Protos.Key
extends com.google.protobuf.GeneratedMessage
implements Protos.KeyOrBuilder

Protobuf type wallet.Key


 A key used to control Bitcoin spending.

 Either the private key, the public key or both may be present.  It is recommended that
 if the private key is provided that the public key is provided too because deriving it is slow.

 If only the public key is provided, the key can only be used to watch the blockchain and verify
 transactions, and not for spending.
 

See Also:
Serialized Form

Nested Class Summary
static class Protos.Key.Builder
          Protobuf type wallet.Key
static class Protos.Key.Type
          Protobuf enum wallet.Key.Type
 
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.BuilderParent, com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessage.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessage.ExtendableBuilder>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessage.ExtendableMessage>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessage.ExtendableMessage>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingType extends com.google.protobuf.Message,Type>
 
Field Summary
static int CREATION_TIMESTAMP_FIELD_NUMBER
           
static int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER
           
static int LABEL_FIELD_NUMBER
           
static com.google.protobuf.Parser<Protos.Key> PARSER
           
static int PRIVATE_KEY_FIELD_NUMBER
           
static int PUBLIC_KEY_FIELD_NUMBER
           
static int TYPE_FIELD_NUMBER
           
 
Fields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders
 
Method Summary
 long getCreationTimestamp()
          optional int64 creation_timestamp = 5;
static Protos.Key getDefaultInstance()
           
 Protos.Key getDefaultInstanceForType()
           
static com.google.protobuf.Descriptors.Descriptor getDescriptor()
           
 Protos.EncryptedPrivateKey getEncryptedPrivateKey()
          optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
 Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder()
          optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
 String getLabel()
          optional string label = 4;
 com.google.protobuf.ByteString getLabelBytes()
          optional string label = 4;
 com.google.protobuf.Parser<Protos.Key> getParserForType()
           
 com.google.protobuf.ByteString getPrivateKey()
          optional bytes private_key = 2;
 com.google.protobuf.ByteString getPublicKey()
          optional bytes public_key = 3;
 int getSerializedSize()
           
 Protos.Key.Type getType()
          required .wallet.Key.Type type = 1;
 com.google.protobuf.UnknownFieldSet getUnknownFields()
           
 boolean hasCreationTimestamp()
          optional int64 creation_timestamp = 5;
 boolean hasEncryptedPrivateKey()
          optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
 boolean hasLabel()
          optional string label = 4;
 boolean hasPrivateKey()
          optional bytes private_key = 2;
 boolean hasPublicKey()
          optional bytes public_key = 3;
 boolean hasType()
          required .wallet.Key.Type type = 1;
protected  com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
           
 boolean isInitialized()
           
static Protos.Key.Builder newBuilder()
           
static Protos.Key.Builder newBuilder(Protos.Key prototype)
           
 Protos.Key.Builder newBuilderForType()
           
protected  Protos.Key.Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
           
static Protos.Key parseDelimitedFrom(InputStream input)
           
static Protos.Key parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           
static Protos.Key parseFrom(byte[] data)
           
static Protos.Key parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           
static Protos.Key parseFrom(com.google.protobuf.ByteString data)
           
static Protos.Key parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           
static Protos.Key parseFrom(com.google.protobuf.CodedInputStream input)
           
static Protos.Key parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           
static Protos.Key parseFrom(InputStream input)
           
static Protos.Key parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           
 Protos.Key.Builder toBuilder()
           
protected  Object writeReplace()
           
 void writeTo(com.google.protobuf.CodedOutputStream output)
           
 
Methods inherited from class com.google.protobuf.GeneratedMessage
getAllFields, getDescriptorForType, getField, getRepeatedField, getRepeatedFieldCount, hasField, makeExtensionsImmutable, newFileScopedGeneratedExtension, newMessageScopedGeneratedExtension, parseUnknownField
 
Methods inherited from class com.google.protobuf.AbstractMessage
equals, findInitializationErrors, getInitializationErrorString, hashBoolean, hashCode, hashEnum, hashEnumList, hashFields, hashLong, toString
 
Methods inherited from class com.google.protobuf.AbstractMessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getRepeatedField, getRepeatedFieldCount, hasField
 
Methods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
 

Field Detail

PARSER

public static com.google.protobuf.Parser<Protos.Key> PARSER

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
See Also:
Constant Field Values

PRIVATE_KEY_FIELD_NUMBER

public static final int PRIVATE_KEY_FIELD_NUMBER
See Also:
Constant Field Values

ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER

public static final int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER
See Also:
Constant Field Values

PUBLIC_KEY_FIELD_NUMBER

public static final int PUBLIC_KEY_FIELD_NUMBER
See Also:
Constant Field Values

LABEL_FIELD_NUMBER

public static final int LABEL_FIELD_NUMBER
See Also:
Constant Field Values

CREATION_TIMESTAMP_FIELD_NUMBER

public static final int CREATION_TIMESTAMP_FIELD_NUMBER
See Also:
Constant Field Values
Method Detail

getDefaultInstance

public static Protos.Key getDefaultInstance()

getDefaultInstanceForType

public Protos.Key getDefaultInstanceForType()
Specified by:
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
Specified by:
getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder

getUnknownFields

public final com.google.protobuf.UnknownFieldSet getUnknownFields()
Specified by:
getUnknownFields in interface com.google.protobuf.MessageOrBuilder
Overrides:
getUnknownFields in class com.google.protobuf.GeneratedMessage

getDescriptor

public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()

internalGetFieldAccessorTable

protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Specified by:
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage

getParserForType

public com.google.protobuf.Parser<Protos.Key> getParserForType()
Specified by:
getParserForType in interface com.google.protobuf.Message
Specified by:
getParserForType in interface com.google.protobuf.MessageLite
Overrides:
getParserForType in class com.google.protobuf.GeneratedMessage

hasType

public boolean hasType()
required .wallet.Key.Type type = 1;

Specified by:
hasType in interface Protos.KeyOrBuilder

getType

public Protos.Key.Type getType()
required .wallet.Key.Type type = 1;

Specified by:
getType in interface Protos.KeyOrBuilder

hasPrivateKey

public boolean hasPrivateKey()
optional bytes private_key = 2;
 The private EC key bytes without any ASN.1 wrapping.
 

Specified by:
hasPrivateKey in interface Protos.KeyOrBuilder

getPrivateKey

public com.google.protobuf.ByteString getPrivateKey()
optional bytes private_key = 2;
 The private EC key bytes without any ASN.1 wrapping.
 

Specified by:
getPrivateKey in interface Protos.KeyOrBuilder

hasEncryptedPrivateKey

public boolean hasEncryptedPrivateKey()
optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
 The message containing the encrypted private EC key information.
 When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
 This is for security of the private key information.
 

Specified by:
hasEncryptedPrivateKey in interface Protos.KeyOrBuilder

getEncryptedPrivateKey

public Protos.EncryptedPrivateKey getEncryptedPrivateKey()
optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
 The message containing the encrypted private EC key information.
 When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
 This is for security of the private key information.
 

Specified by:
getEncryptedPrivateKey in interface Protos.KeyOrBuilder

getEncryptedPrivateKeyOrBuilder

public Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder()
optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
 The message containing the encrypted private EC key information.
 When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
 This is for security of the private key information.
 

Specified by:
getEncryptedPrivateKeyOrBuilder in interface Protos.KeyOrBuilder

hasPublicKey

public boolean hasPublicKey()
optional bytes public_key = 3;
 The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
 do lots of slow EC math on startup.
 

Specified by:
hasPublicKey in interface Protos.KeyOrBuilder

getPublicKey

public com.google.protobuf.ByteString getPublicKey()
optional bytes public_key = 3;
 The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
 do lots of slow EC math on startup.
 

Specified by:
getPublicKey in interface Protos.KeyOrBuilder

hasLabel

public boolean hasLabel()
optional string label = 4;
 User-provided label associated with the key.
 

Specified by:
hasLabel in interface Protos.KeyOrBuilder

getLabel

public String getLabel()
optional string label = 4;
 User-provided label associated with the key.
 

Specified by:
getLabel in interface Protos.KeyOrBuilder

getLabelBytes

public com.google.protobuf.ByteString getLabelBytes()
optional string label = 4;
 User-provided label associated with the key.
 

Specified by:
getLabelBytes in interface Protos.KeyOrBuilder

hasCreationTimestamp

public boolean hasCreationTimestamp()
optional int64 creation_timestamp = 5;
 Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
 

Specified by:
hasCreationTimestamp in interface Protos.KeyOrBuilder

getCreationTimestamp

public long getCreationTimestamp()
optional int64 creation_timestamp = 5;
 Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
 

Specified by:
getCreationTimestamp in interface Protos.KeyOrBuilder

isInitialized

public final boolean isInitialized()
Specified by:
isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
Overrides:
isInitialized in class com.google.protobuf.GeneratedMessage

writeTo

public void writeTo(com.google.protobuf.CodedOutputStream output)
             throws IOException
Specified by:
writeTo in interface com.google.protobuf.MessageLite
Overrides:
writeTo in class com.google.protobuf.AbstractMessage
Throws:
IOException

getSerializedSize

public int getSerializedSize()
Specified by:
getSerializedSize in interface com.google.protobuf.MessageLite
Overrides:
getSerializedSize in class com.google.protobuf.AbstractMessage

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Overrides:
writeReplace in class com.google.protobuf.GeneratedMessage
Throws:
ObjectStreamException

parseFrom

public static Protos.Key parseFrom(com.google.protobuf.ByteString data)
                            throws com.google.protobuf.InvalidProtocolBufferException
Throws:
com.google.protobuf.InvalidProtocolBufferException

parseFrom

public static Protos.Key parseFrom(com.google.protobuf.ByteString data,
                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                            throws com.google.protobuf.InvalidProtocolBufferException
Throws:
com.google.protobuf.InvalidProtocolBufferException

parseFrom

public static Protos.Key parseFrom(byte[] data)
                            throws com.google.protobuf.InvalidProtocolBufferException
Throws:
com.google.protobuf.InvalidProtocolBufferException

parseFrom

public static Protos.Key parseFrom(byte[] data,
                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                            throws com.google.protobuf.InvalidProtocolBufferException
Throws:
com.google.protobuf.InvalidProtocolBufferException

parseFrom

public static Protos.Key parseFrom(InputStream input)
                            throws IOException
Throws:
IOException

parseFrom

public static Protos.Key parseFrom(InputStream input,
                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                            throws IOException
Throws:
IOException

parseDelimitedFrom

public static Protos.Key parseDelimitedFrom(InputStream input)
                                     throws IOException
Throws:
IOException

parseDelimitedFrom

public static Protos.Key parseDelimitedFrom(InputStream input,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws IOException
Throws:
IOException

parseFrom

public static Protos.Key parseFrom(com.google.protobuf.CodedInputStream input)
                            throws IOException
Throws:
IOException

parseFrom

public static Protos.Key parseFrom(com.google.protobuf.CodedInputStream input,
                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                            throws IOException
Throws:
IOException

newBuilder

public static Protos.Key.Builder newBuilder()

newBuilderForType

public Protos.Key.Builder newBuilderForType()
Specified by:
newBuilderForType in interface com.google.protobuf.Message
Specified by:
newBuilderForType in interface com.google.protobuf.MessageLite

newBuilder

public static Protos.Key.Builder newBuilder(Protos.Key prototype)

toBuilder

public Protos.Key.Builder toBuilder()
Specified by:
toBuilder in interface com.google.protobuf.Message
Specified by:
toBuilder in interface com.google.protobuf.MessageLite

newBuilderForType

protected Protos.Key.Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
Specified by:
newBuilderForType in class com.google.protobuf.GeneratedMessage


Copyright © 2014. All rights reserved.