Package org.bitcoinj.wallet
Class Protos.Key.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<Protos.Key,Protos.Key.Builder>
org.bitcoinj.wallet.Protos.Key.Builder
- All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,Cloneable
,Protos.KeyOrBuilder
- Enclosing class:
- Protos.Key
public static final class Protos.Key.Builder
extends com.google.protobuf.GeneratedMessageLite.Builder<Protos.Key,Protos.Key.Builder>
implements Protos.KeyOrBuilder
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.Protobuf type
wallet.Key
-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance, isBuilt
-
Method Summary
Modifier and TypeMethodDescriptionaddAccountPath
(int value) The path to the root.addAllAccountPath
(Iterable<? extends Integer> values) The path to the root.The path to the root.Timestamp stored as millis since epoch.optional .wallet.DeterministicKey deterministic_key = 7;
The seed for a deterministic key hierarchy.If the secret data is encrypted, then secret_bytes is missing and this field is set.Encrypted version of the seedUser-provided label associated with the key.Type of addresses (aka output scripts) to generate for receiving.The public EC key derived from the private key.Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.required .wallet.Key.Type type = 1;
int
getAccountPath
(int index) The path to the root.int
The path to the root.The path to the root.long
Timestamp stored as millis since epoch.optional .wallet.DeterministicKey deterministic_key = 7;
com.google.protobuf.ByteString
The seed for a deterministic key hierarchy.If the secret data is encrypted, then secret_bytes is missing and this field is set.Encrypted version of the seedgetLabel()
User-provided label associated with the key.com.google.protobuf.ByteString
User-provided label associated with the key.Type of addresses (aka output scripts) to generate for receiving.com.google.protobuf.ByteString
The public EC key derived from the private key.com.google.protobuf.ByteString
Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.getType()
required .wallet.Key.Type type = 1;
boolean
Timestamp stored as millis since epoch.boolean
optional .wallet.DeterministicKey deterministic_key = 7;
boolean
The seed for a deterministic key hierarchy.boolean
If the secret data is encrypted, then secret_bytes is missing and this field is set.boolean
Encrypted version of the seedboolean
hasLabel()
User-provided label associated with the key.boolean
Type of addresses (aka output scripts) to generate for receiving.boolean
The public EC key derived from the private key.boolean
Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.boolean
hasType()
required .wallet.Key.Type type = 1;
optional .wallet.DeterministicKey deterministic_key = 7;
If the secret data is encrypted, then secret_bytes is missing and this field is set.Encrypted version of the seedsetAccountPath
(int index, int value) The path to the root.setCreationTimestamp
(long value) Timestamp stored as millis since epoch.optional .wallet.DeterministicKey deterministic_key = 7;
setDeterministicKey
(Protos.DeterministicKey.Builder builderForValue) optional .wallet.DeterministicKey deterministic_key = 7;
setDeterministicSeed
(com.google.protobuf.ByteString value) The seed for a deterministic key hierarchy.If the secret data is encrypted, then secret_bytes is missing and this field is set.setEncryptedData
(Protos.EncryptedData.Builder builderForValue) If the secret data is encrypted, then secret_bytes is missing and this field is set.Encrypted version of the seedsetEncryptedDeterministicSeed
(Protos.EncryptedData.Builder builderForValue) Encrypted version of the seedUser-provided label associated with the key.setLabelBytes
(com.google.protobuf.ByteString value) User-provided label associated with the key.Type of addresses (aka output scripts) to generate for receiving.setPublicKey
(com.google.protobuf.ByteString value) The public EC key derived from the private key.setSecretBytes
(com.google.protobuf.ByteString value) Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed.setType
(Protos.Key.Type value) required .wallet.Key.Type type = 1;
Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Method Details
-
hasType
public boolean hasType()required .wallet.Key.Type type = 1;
- Specified by:
hasType
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the type field is set.
-
getType
required .wallet.Key.Type type = 1;
- Specified by:
getType
in interfaceProtos.KeyOrBuilder
- Returns:
- The type.
-
setType
required .wallet.Key.Type type = 1;
- Parameters:
value
- The enum numeric value on the wire for type to set.- Returns:
- This builder for chaining.
-
clearType
required .wallet.Key.Type type = 1;
- Returns:
- This builder for chaining.
-
hasSecretBytes
public boolean hasSecretBytes()Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed. If the secret is encrypted, or this is a "watching entry" then this is missing.
optional bytes secret_bytes = 2;
- Specified by:
hasSecretBytes
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the secretBytes field is set.
-
getSecretBytes
public com.google.protobuf.ByteString getSecretBytes()Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed. If the secret is encrypted, or this is a "watching entry" then this is missing.
optional bytes secret_bytes = 2;
- Specified by:
getSecretBytes
in interfaceProtos.KeyOrBuilder
- Returns:
- The secretBytes.
-
setSecretBytes
Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed. If the secret is encrypted, or this is a "watching entry" then this is missing.
optional bytes secret_bytes = 2;
- Parameters:
value
- The secretBytes to set.- Returns:
- This builder for chaining.
-
clearSecretBytes
Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed. If the secret is encrypted, or this is a "watching entry" then this is missing.
optional bytes secret_bytes = 2;
- Returns:
- This builder for chaining.
-
hasEncryptedData
public boolean hasEncryptedData()If the secret data is encrypted, then secret_bytes is missing and this field is set.
optional .wallet.EncryptedData encrypted_data = 6;
- Specified by:
hasEncryptedData
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the encryptedData field is set.
-
getEncryptedData
If the secret data is encrypted, then secret_bytes is missing and this field is set.
optional .wallet.EncryptedData encrypted_data = 6;
- Specified by:
getEncryptedData
in interfaceProtos.KeyOrBuilder
- Returns:
- The encryptedData.
-
setEncryptedData
If the secret data is encrypted, then secret_bytes is missing and this field is set.
optional .wallet.EncryptedData encrypted_data = 6;
-
setEncryptedData
If the secret data is encrypted, then secret_bytes is missing and this field is set.
optional .wallet.EncryptedData encrypted_data = 6;
-
mergeEncryptedData
If the secret data is encrypted, then secret_bytes is missing and this field is set.
optional .wallet.EncryptedData encrypted_data = 6;
-
clearEncryptedData
If the secret data is encrypted, then secret_bytes is missing and this field is set.
optional .wallet.EncryptedData encrypted_data = 6;
-
hasPublicKey
public boolean hasPublicKey()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. For DETERMINISTIC_MNEMONIC entries this is missing.
optional bytes public_key = 3;
- Specified by:
hasPublicKey
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the publicKey field is set.
-
getPublicKey
public com.google.protobuf.ByteString getPublicKey()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. For DETERMINISTIC_MNEMONIC entries this is missing.
optional bytes public_key = 3;
- Specified by:
getPublicKey
in interfaceProtos.KeyOrBuilder
- Returns:
- The publicKey.
-
setPublicKey
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. For DETERMINISTIC_MNEMONIC entries this is missing.
optional bytes public_key = 3;
- Parameters:
value
- The publicKey to set.- Returns:
- This builder for chaining.
-
clearPublicKey
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. For DETERMINISTIC_MNEMONIC entries this is missing.
optional bytes public_key = 3;
- Returns:
- This builder for chaining.
-
hasLabel
public boolean hasLabel()User-provided label associated with the key.
optional string label = 4;
- Specified by:
hasLabel
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the label field is set.
-
getLabel
User-provided label associated with the key.
optional string label = 4;
- Specified by:
getLabel
in interfaceProtos.KeyOrBuilder
- Returns:
- The label.
-
getLabelBytes
public com.google.protobuf.ByteString getLabelBytes()User-provided label associated with the key.
optional string label = 4;
- Specified by:
getLabelBytes
in interfaceProtos.KeyOrBuilder
- Returns:
- The bytes for label.
-
setLabel
User-provided label associated with the key.
optional string label = 4;
- Parameters:
value
- The label to set.- Returns:
- This builder for chaining.
-
clearLabel
User-provided label associated with the key.
optional string label = 4;
- Returns:
- This builder for chaining.
-
setLabelBytes
User-provided label associated with the key.
optional string label = 4;
- Parameters:
value
- The bytes for label to set.- Returns:
- This builder for chaining.
-
hasCreationTimestamp
public boolean hasCreationTimestamp()Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's optional is that keys derived from a parent don't have this data.
optional int64 creation_timestamp = 5;
- Specified by:
hasCreationTimestamp
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the creationTimestamp field is set.
-
getCreationTimestamp
public long getCreationTimestamp()Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's optional is that keys derived from a parent don't have this data.
optional int64 creation_timestamp = 5;
- Specified by:
getCreationTimestamp
in interfaceProtos.KeyOrBuilder
- Returns:
- The creationTimestamp.
-
setCreationTimestamp
Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's optional is that keys derived from a parent don't have this data.
optional int64 creation_timestamp = 5;
- Parameters:
value
- The creationTimestamp to set.- Returns:
- This builder for chaining.
-
clearCreationTimestamp
Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. The reason it's optional is that keys derived from a parent don't have this data.
optional int64 creation_timestamp = 5;
- Returns:
- This builder for chaining.
-
hasDeterministicKey
public boolean hasDeterministicKey()optional .wallet.DeterministicKey deterministic_key = 7;
- Specified by:
hasDeterministicKey
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the deterministicKey field is set.
-
getDeterministicKey
optional .wallet.DeterministicKey deterministic_key = 7;
- Specified by:
getDeterministicKey
in interfaceProtos.KeyOrBuilder
- Returns:
- The deterministicKey.
-
setDeterministicKey
optional .wallet.DeterministicKey deterministic_key = 7;
-
setDeterministicKey
optional .wallet.DeterministicKey deterministic_key = 7;
-
mergeDeterministicKey
optional .wallet.DeterministicKey deterministic_key = 7;
-
clearDeterministicKey
optional .wallet.DeterministicKey deterministic_key = 7;
-
hasDeterministicSeed
public boolean hasDeterministicSeed()The seed for a deterministic key hierarchy. Derived from the mnemonic, but cached here for quick startup. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
optional bytes deterministic_seed = 8;
- Specified by:
hasDeterministicSeed
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the deterministicSeed field is set.
-
getDeterministicSeed
public com.google.protobuf.ByteString getDeterministicSeed()The seed for a deterministic key hierarchy. Derived from the mnemonic, but cached here for quick startup. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
optional bytes deterministic_seed = 8;
- Specified by:
getDeterministicSeed
in interfaceProtos.KeyOrBuilder
- Returns:
- The deterministicSeed.
-
setDeterministicSeed
The seed for a deterministic key hierarchy. Derived from the mnemonic, but cached here for quick startup. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
optional bytes deterministic_seed = 8;
- Parameters:
value
- The deterministicSeed to set.- Returns:
- This builder for chaining.
-
clearDeterministicSeed
The seed for a deterministic key hierarchy. Derived from the mnemonic, but cached here for quick startup. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
optional bytes deterministic_seed = 8;
- Returns:
- This builder for chaining.
-
hasEncryptedDeterministicSeed
public boolean hasEncryptedDeterministicSeed()Encrypted version of the seed
optional .wallet.EncryptedData encrypted_deterministic_seed = 9;
- Specified by:
hasEncryptedDeterministicSeed
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the encryptedDeterministicSeed field is set.
-
getEncryptedDeterministicSeed
Encrypted version of the seed
optional .wallet.EncryptedData encrypted_deterministic_seed = 9;
- Specified by:
getEncryptedDeterministicSeed
in interfaceProtos.KeyOrBuilder
- Returns:
- The encryptedDeterministicSeed.
-
setEncryptedDeterministicSeed
Encrypted version of the seed
optional .wallet.EncryptedData encrypted_deterministic_seed = 9;
-
setEncryptedDeterministicSeed
public Protos.Key.Builder setEncryptedDeterministicSeed(Protos.EncryptedData.Builder builderForValue) Encrypted version of the seed
optional .wallet.EncryptedData encrypted_deterministic_seed = 9;
-
mergeEncryptedDeterministicSeed
Encrypted version of the seed
optional .wallet.EncryptedData encrypted_deterministic_seed = 9;
-
clearEncryptedDeterministicSeed
Encrypted version of the seed
optional .wallet.EncryptedData encrypted_deterministic_seed = 9;
-
getAccountPathList
The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
repeated uint32 account_path = 10 [packed = true];
- Specified by:
getAccountPathList
in interfaceProtos.KeyOrBuilder
- Returns:
- A list containing the accountPath.
-
getAccountPathCount
public int getAccountPathCount()The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
repeated uint32 account_path = 10 [packed = true];
- Specified by:
getAccountPathCount
in interfaceProtos.KeyOrBuilder
- Returns:
- The count of accountPath.
-
getAccountPath
public int getAccountPath(int index) The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
repeated uint32 account_path = 10 [packed = true];
- Specified by:
getAccountPath
in interfaceProtos.KeyOrBuilder
- Parameters:
index
- The index of the element to return.- Returns:
- The accountPath at the given index.
-
setAccountPath
The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
repeated uint32 account_path = 10 [packed = true];
- Parameters:
value
- The accountPath to set.- Returns:
- This builder for chaining.
-
addAccountPath
The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
repeated uint32 account_path = 10 [packed = true];
- Parameters:
value
- The accountPath to add.- Returns:
- This builder for chaining.
-
addAllAccountPath
The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
repeated uint32 account_path = 10 [packed = true];
- Parameters:
values
- The accountPath to add.- Returns:
- This builder for chaining.
-
clearAccountPath
The path to the root. Only applicable to a DETERMINISTIC_MNEMONIC key entry.
repeated uint32 account_path = 10 [packed = true];
- Returns:
- This builder for chaining.
-
hasOutputScriptType
public boolean hasOutputScriptType()Type of addresses (aka output scripts) to generate for receiving.
optional .wallet.Key.OutputScriptType output_script_type = 11;
- Specified by:
hasOutputScriptType
in interfaceProtos.KeyOrBuilder
- Returns:
- Whether the outputScriptType field is set.
-
getOutputScriptType
Type of addresses (aka output scripts) to generate for receiving.
optional .wallet.Key.OutputScriptType output_script_type = 11;
- Specified by:
getOutputScriptType
in interfaceProtos.KeyOrBuilder
- Returns:
- The outputScriptType.
-
setOutputScriptType
Type of addresses (aka output scripts) to generate for receiving.
optional .wallet.Key.OutputScriptType output_script_type = 11;
- Parameters:
value
- The enum numeric value on the wire for outputScriptType to set.- Returns:
- This builder for chaining.
-
clearOutputScriptType
Type of addresses (aka output scripts) to generate for receiving.
optional .wallet.Key.OutputScriptType output_script_type = 11;
- Returns:
- This builder for chaining.
-