/core/src/main/java/org/bitcoinj/wallet/Protos.java
https://code.google.com/ · Java · 12763 lines · 8241 code · 597 blank · 3925 comment · 1364 complexity · b3df529ded99ef4f09f75f868c89ba96 MD5 · raw file
Large files are truncated click here to view the full file
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- // source: bitcoin.proto
- package org.bitcoinj.wallet;
- public final class Protos {
- private Protos() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- }
- public interface PeerAddressOrBuilder
- extends com.google.protobuf.MessageOrBuilder {
- // required bytes ip_address = 1;
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- boolean hasIpAddress();
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- com.google.protobuf.ByteString getIpAddress();
- // required uint32 port = 2;
- /**
- * <code>required uint32 port = 2;</code>
- */
- boolean hasPort();
- /**
- * <code>required uint32 port = 2;</code>
- */
- int getPort();
- // required uint64 services = 3;
- /**
- * <code>required uint64 services = 3;</code>
- */
- boolean hasServices();
- /**
- * <code>required uint64 services = 3;</code>
- */
- long getServices();
- }
- /**
- * Protobuf type {@code wallet.PeerAddress}
- */
- public static final class PeerAddress extends
- com.google.protobuf.GeneratedMessage
- implements PeerAddressOrBuilder {
- // Use PeerAddress.newBuilder() to construct.
- private PeerAddress(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
- super(builder);
- this.unknownFields = builder.getUnknownFields();
- }
- private PeerAddress(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
- private static final PeerAddress defaultInstance;
- public static PeerAddress getDefaultInstance() {
- return defaultInstance;
- }
- public PeerAddress getDefaultInstanceForType() {
- return defaultInstance;
- }
- private final com.google.protobuf.UnknownFieldSet unknownFields;
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private PeerAddress(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- initFields();
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- case 10: {
- bitField0_ |= 0x00000001;
- ipAddress_ = input.readBytes();
- break;
- }
- case 16: {
- bitField0_ |= 0x00000002;
- port_ = input.readUInt32();
- break;
- }
- case 24: {
- bitField0_ |= 0x00000004;
- services_ = input.readUInt64();
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e.getMessage()).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor;
- }
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class);
- }
- public static com.google.protobuf.Parser<PeerAddress> PARSER =
- new com.google.protobuf.AbstractParser<PeerAddress>() {
- public PeerAddress parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new PeerAddress(input, extensionRegistry);
- }
- };
- @java.lang.Override
- public com.google.protobuf.Parser<PeerAddress> getParserForType() {
- return PARSER;
- }
- private int bitField0_;
- // required bytes ip_address = 1;
- public static final int IP_ADDRESS_FIELD_NUMBER = 1;
- private com.google.protobuf.ByteString ipAddress_;
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- public boolean hasIpAddress() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- public com.google.protobuf.ByteString getIpAddress() {
- return ipAddress_;
- }
- // required uint32 port = 2;
- public static final int PORT_FIELD_NUMBER = 2;
- private int port_;
- /**
- * <code>required uint32 port = 2;</code>
- */
- public boolean hasPort() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>required uint32 port = 2;</code>
- */
- public int getPort() {
- return port_;
- }
- // required uint64 services = 3;
- public static final int SERVICES_FIELD_NUMBER = 3;
- private long services_;
- /**
- * <code>required uint64 services = 3;</code>
- */
- public boolean hasServices() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
- }
- /**
- * <code>required uint64 services = 3;</code>
- */
- public long getServices() {
- return services_;
- }
- private void initFields() {
- ipAddress_ = com.google.protobuf.ByteString.EMPTY;
- port_ = 0;
- services_ = 0L;
- }
- private byte memoizedIsInitialized = -1;
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized != -1) return isInitialized == 1;
- if (!hasIpAddress()) {
- memoizedIsInitialized = 0;
- return false;
- }
- if (!hasPort()) {
- memoizedIsInitialized = 0;
- return false;
- }
- if (!hasServices()) {
- memoizedIsInitialized = 0;
- return false;
- }
- memoizedIsInitialized = 1;
- return true;
- }
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getSerializedSize();
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, ipAddress_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeUInt32(2, port_);
- }
- if (((bitField0_ & 0x00000004) == 0x00000004)) {
- output.writeUInt64(3, services_);
- }
- getUnknownFields().writeTo(output);
- }
- private int memoizedSerializedSize = -1;
- public int getSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- size = 0;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, ipAddress_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(2, port_);
- }
- if (((bitField0_ & 0x00000004) == 0x00000004)) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt64Size(3, services_);
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSerializedSize = size;
- return size;
- }
- private static final long serialVersionUID = 0L;
- @java.lang.Override
- protected java.lang.Object writeReplace()
- throws java.io.ObjectStreamException {
- return super.writeReplace();
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseFrom(input, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseDelimitedFrom(input);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseDelimitedFrom(input, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseFrom(input, extensionRegistry);
- }
- public static Builder newBuilder() { return Builder.create(); }
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder(org.bitcoinj.wallet.Protos.PeerAddress prototype) {
- return newBuilder().mergeFrom(prototype);
- }
- public Builder toBuilder() { return newBuilder(this); }
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code wallet.PeerAddress}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements org.bitcoinj.wallet.Protos.PeerAddressOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor;
- }
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class);
- }
- // Construct using org.bitcoinj.wallet.Protos.PeerAddress.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
- private Builder(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- }
- }
- private static Builder create() {
- return new Builder();
- }
- public Builder clear() {
- super.clear();
- ipAddress_ = com.google.protobuf.ByteString.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000001);
- port_ = 0;
- bitField0_ = (bitField0_ & ~0x00000002);
- services_ = 0L;
- bitField0_ = (bitField0_ & ~0x00000004);
- return this;
- }
- public Builder clone() {
- return create().mergeFrom(buildPartial());
- }
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor;
- }
- public org.bitcoinj.wallet.Protos.PeerAddress getDefaultInstanceForType() {
- return org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance();
- }
- public org.bitcoinj.wallet.Protos.PeerAddress build() {
- org.bitcoinj.wallet.Protos.PeerAddress result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
- public org.bitcoinj.wallet.Protos.PeerAddress buildPartial() {
- org.bitcoinj.wallet.Protos.PeerAddress result = new org.bitcoinj.wallet.Protos.PeerAddress(this);
- int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
- if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
- to_bitField0_ |= 0x00000001;
- }
- result.ipAddress_ = ipAddress_;
- if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
- to_bitField0_ |= 0x00000002;
- }
- result.port_ = port_;
- if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
- to_bitField0_ |= 0x00000004;
- }
- result.services_ = services_;
- result.bitField0_ = to_bitField0_;
- onBuilt();
- return result;
- }
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof org.bitcoinj.wallet.Protos.PeerAddress) {
- return mergeFrom((org.bitcoinj.wallet.Protos.PeerAddress)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
- public Builder mergeFrom(org.bitcoinj.wallet.Protos.PeerAddress other) {
- if (other == org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance()) return this;
- if (other.hasIpAddress()) {
- setIpAddress(other.getIpAddress());
- }
- if (other.hasPort()) {
- setPort(other.getPort());
- }
- if (other.hasServices()) {
- setServices(other.getServices());
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
- public final boolean isInitialized() {
- if (!hasIpAddress()) {
-
- return false;
- }
- if (!hasPort()) {
-
- return false;
- }
- if (!hasServices()) {
-
- return false;
- }
- return true;
- }
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- org.bitcoinj.wallet.Protos.PeerAddress parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (org.bitcoinj.wallet.Protos.PeerAddress) e.getUnfinishedMessage();
- throw e;
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
- private int bitField0_;
- // required bytes ip_address = 1;
- private com.google.protobuf.ByteString ipAddress_ = com.google.protobuf.ByteString.EMPTY;
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- public boolean hasIpAddress() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- public com.google.protobuf.ByteString getIpAddress() {
- return ipAddress_;
- }
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- public Builder setIpAddress(com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- ipAddress_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>required bytes ip_address = 1;</code>
- */
- public Builder clearIpAddress() {
- bitField0_ = (bitField0_ & ~0x00000001);
- ipAddress_ = getDefaultInstance().getIpAddress();
- onChanged();
- return this;
- }
- // required uint32 port = 2;
- private int port_ ;
- /**
- * <code>required uint32 port = 2;</code>
- */
- public boolean hasPort() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>required uint32 port = 2;</code>
- */
- public int getPort() {
- return port_;
- }
- /**
- * <code>required uint32 port = 2;</code>
- */
- public Builder setPort(int value) {
- bitField0_ |= 0x00000002;
- port_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>required uint32 port = 2;</code>
- */
- public Builder clearPort() {
- bitField0_ = (bitField0_ & ~0x00000002);
- port_ = 0;
- onChanged();
- return this;
- }
- // required uint64 services = 3;
- private long services_ ;
- /**
- * <code>required uint64 services = 3;</code>
- */
- public boolean hasServices() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
- }
- /**
- * <code>required uint64 services = 3;</code>
- */
- public long getServices() {
- return services_;
- }
- /**
- * <code>required uint64 services = 3;</code>
- */
- public Builder setServices(long value) {
- bitField0_ |= 0x00000004;
- services_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>required uint64 services = 3;</code>
- */
- public Builder clearServices() {
- bitField0_ = (bitField0_ & ~0x00000004);
- services_ = 0L;
- onChanged();
- return this;
- }
- // @@protoc_insertion_point(builder_scope:wallet.PeerAddress)
- }
- static {
- defaultInstance = new PeerAddress(true);
- defaultInstance.initFields();
- }
- // @@protoc_insertion_point(class_scope:wallet.PeerAddress)
- }
- public interface EncryptedPrivateKeyOrBuilder
- extends com.google.protobuf.MessageOrBuilder {
- // required bytes initialisation_vector = 1;
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- boolean hasInitialisationVector();
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- com.google.protobuf.ByteString getInitialisationVector();
- // required bytes encrypted_private_key = 2;
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- boolean hasEncryptedPrivateKey();
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- com.google.protobuf.ByteString getEncryptedPrivateKey();
- }
- /**
- * Protobuf type {@code wallet.EncryptedPrivateKey}
- *
- * <pre>
- **
- * The data to store a private key encrypted with Scrypt and AES
- * </pre>
- */
- public static final class EncryptedPrivateKey extends
- com.google.protobuf.GeneratedMessage
- implements EncryptedPrivateKeyOrBuilder {
- // Use EncryptedPrivateKey.newBuilder() to construct.
- private EncryptedPrivateKey(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
- super(builder);
- this.unknownFields = builder.getUnknownFields();
- }
- private EncryptedPrivateKey(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
- private static final EncryptedPrivateKey defaultInstance;
- public static EncryptedPrivateKey getDefaultInstance() {
- return defaultInstance;
- }
- public EncryptedPrivateKey getDefaultInstanceForType() {
- return defaultInstance;
- }
- private final com.google.protobuf.UnknownFieldSet unknownFields;
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private EncryptedPrivateKey(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- initFields();
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- case 10: {
- bitField0_ |= 0x00000001;
- initialisationVector_ = input.readBytes();
- break;
- }
- case 18: {
- bitField0_ |= 0x00000002;
- encryptedPrivateKey_ = input.readBytes();
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e.getMessage()).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor;
- }
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- org.bitcoinj.wallet.Protos.EncryptedPrivateKey.class, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder.class);
- }
- public static com.google.protobuf.Parser<EncryptedPrivateKey> PARSER =
- new com.google.protobuf.AbstractParser<EncryptedPrivateKey>() {
- public EncryptedPrivateKey parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new EncryptedPrivateKey(input, extensionRegistry);
- }
- };
- @java.lang.Override
- public com.google.protobuf.Parser<EncryptedPrivateKey> getParserForType() {
- return PARSER;
- }
- private int bitField0_;
- // required bytes initialisation_vector = 1;
- public static final int INITIALISATION_VECTOR_FIELD_NUMBER = 1;
- private com.google.protobuf.ByteString initialisationVector_;
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- public boolean hasInitialisationVector() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- public com.google.protobuf.ByteString getInitialisationVector() {
- return initialisationVector_;
- }
- // required bytes encrypted_private_key = 2;
- public static final int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER = 2;
- private com.google.protobuf.ByteString encryptedPrivateKey_;
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- public boolean hasEncryptedPrivateKey() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- public com.google.protobuf.ByteString getEncryptedPrivateKey() {
- return encryptedPrivateKey_;
- }
- private void initFields() {
- initialisationVector_ = com.google.protobuf.ByteString.EMPTY;
- encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY;
- }
- private byte memoizedIsInitialized = -1;
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized != -1) return isInitialized == 1;
- if (!hasInitialisationVector()) {
- memoizedIsInitialized = 0;
- return false;
- }
- if (!hasEncryptedPrivateKey()) {
- memoizedIsInitialized = 0;
- return false;
- }
- memoizedIsInitialized = 1;
- return true;
- }
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getSerializedSize();
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, initialisationVector_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeBytes(2, encryptedPrivateKey_);
- }
- getUnknownFields().writeTo(output);
- }
- private int memoizedSerializedSize = -1;
- public int getSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- size = 0;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, initialisationVector_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(2, encryptedPrivateKey_);
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSerializedSize = size;
- return size;
- }
- private static final long serialVersionUID = 0L;
- @java.lang.Override
- protected java.lang.Object writeReplace()
- throws java.io.ObjectStreamException {
- return super.writeReplace();
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseFrom(input, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return PARSER.parseDelimitedFrom(input);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseDelimitedFrom(input, extensionRegistry);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return PARSER.parseFrom(input);
- }
- public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return PARSER.parseFrom(input, extensionRegistry);
- }
- public static Builder newBuilder() { return Builder.create(); }
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder(org.bitcoinj.wallet.Protos.EncryptedPrivateKey prototype) {
- return newBuilder().mergeFrom(prototype);
- }
- public Builder toBuilder() { return newBuilder(this); }
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code wallet.EncryptedPrivateKey}
- *
- * <pre>
- **
- * The data to store a private key encrypted with Scrypt and AES
- * </pre>
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor;
- }
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- org.bitcoinj.wallet.Protos.EncryptedPrivateKey.class, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder.class);
- }
- // Construct using org.bitcoinj.wallet.Protos.EncryptedPrivateKey.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
- private Builder(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- }
- }
- private static Builder create() {
- return new Builder();
- }
- public Builder clear() {
- super.clear();
- initialisationVector_ = com.google.protobuf.ByteString.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000001);
- encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000002);
- return this;
- }
- public Builder clone() {
- return create().mergeFrom(buildPartial());
- }
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor;
- }
- public org.bitcoinj.wallet.Protos.EncryptedPrivateKey getDefaultInstanceForType() {
- return org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance();
- }
- public org.bitcoinj.wallet.Protos.EncryptedPrivateKey build() {
- org.bitcoinj.wallet.Protos.EncryptedPrivateKey result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
- public org.bitcoinj.wallet.Protos.EncryptedPrivateKey buildPartial() {
- org.bitcoinj.wallet.Protos.EncryptedPrivateKey result = new org.bitcoinj.wallet.Protos.EncryptedPrivateKey(this);
- int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
- if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
- to_bitField0_ |= 0x00000001;
- }
- result.initialisationVector_ = initialisationVector_;
- if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
- to_bitField0_ |= 0x00000002;
- }
- result.encryptedPrivateKey_ = encryptedPrivateKey_;
- result.bitField0_ = to_bitField0_;
- onBuilt();
- return result;
- }
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof org.bitcoinj.wallet.Protos.EncryptedPrivateKey) {
- return mergeFrom((org.bitcoinj.wallet.Protos.EncryptedPrivateKey)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
- public Builder mergeFrom(org.bitcoinj.wallet.Protos.EncryptedPrivateKey other) {
- if (other == org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance()) return this;
- if (other.hasInitialisationVector()) {
- setInitialisationVector(other.getInitialisationVector());
- }
- if (other.hasEncryptedPrivateKey()) {
- setEncryptedPrivateKey(other.getEncryptedPrivateKey());
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
- public final boolean isInitialized() {
- if (!hasInitialisationVector()) {
-
- return false;
- }
- if (!hasEncryptedPrivateKey()) {
-
- return false;
- }
- return true;
- }
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- org.bitcoinj.wallet.Protos.EncryptedPrivateKey parsedMessage = null;
- try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (org.bitcoinj.wallet.Protos.EncryptedPrivateKey) e.getUnfinishedMessage();
- throw e;
- } finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
- return this;
- }
- private int bitField0_;
- // required bytes initialisation_vector = 1;
- private com.google.protobuf.ByteString initialisationVector_ = com.google.protobuf.ByteString.EMPTY;
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- public boolean hasInitialisationVector() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- public com.google.protobuf.ByteString getInitialisationVector() {
- return initialisationVector_;
- }
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- public Builder setInitialisationVector(com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- initialisationVector_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>required bytes initialisation_vector = 1;</code>
- *
- * <pre>
- * The initialisation vector for the AES encryption (16 bytes)
- * </pre>
- */
- public Builder clearInitialisationVector() {
- bitField0_ = (bitField0_ & ~0x00000001);
- initialisationVector_ = getDefaultInstance().getInitialisationVector();
- onChanged();
- return this;
- }
- // required bytes encrypted_private_key = 2;
- private com.google.protobuf.ByteString encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY;
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- public boolean hasEncryptedPrivateKey() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- public com.google.protobuf.ByteString getEncryptedPrivateKey() {
- return encryptedPrivateKey_;
- }
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- public Builder setEncryptedPrivateKey(com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000002;
- encryptedPrivateKey_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>required bytes encrypted_private_key = 2;</code>
- *
- * <pre>
- * The encrypted private key
- * </pre>
- */
- public Builder clearEncryptedPrivateKey() {
- bitField0_ = (bitField0_ & ~0x00000002);
- encryptedPrivateKey_ = getDefaultInstance().getEncryptedPrivateKey();
- onChanged();
- return this;
- }
- // @@protoc_insertion_point(builder_scope:wallet.EncryptedPrivateKey)
- }
- static {
- defaultInstance = new EncryptedPrivateKey(true);
- defaultInstance.initFields();
- }
- // @@protoc_insertion_point(class_scope:wallet.EncryptedPrivateKey)
- }
- public interface KeyOrBuilder
- extends com.google.protobuf.MessageOrBuilder {
- // required .wallet.Key.Type type = 1;
- /**
- * <code>required .wallet.Key.Type type = 1;</code>
- */
- boolean hasType();
- /**
- * <code>required .wallet.Key.Type type = 1;</code>
- */
- org.bitcoinj.wallet.Protos.Key.Type getType();
- // optional bytes private_key = 2;
- /**
- * <code>optional bytes private_key = 2;</code>
- *
- * <pre>
- * The private EC key bytes without any ASN.1 wrapping.
- * </pre>
- */
- boolean hasPrivateKey();
- /**
- * <code>optional bytes private_key = 2;</code>
- *
- * <pre>
- * The private EC key bytes without any ASN.1 wrapping.
- * </pre>
- */
- com.google.protobuf.ByteString getPrivateKey();
- // optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
- /**
- * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
- *
- * <pre>
- * 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.
- * </pre>
- */
- boolean hasEncryptedPrivateKey();
- /**
- * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
- *
- * <pre>
- * 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.
- * </pre>
- */
- org.bitcoinj.wallet.Protos.EncryptedPrivateKey getEncryptedPrivateKey();
- /**
- * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
- *
- * <pre>
- * 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.
- * </pre>
- */
- org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder();
- // optional bytes public_key = 3;
- /**
- * <code>optional bytes public_key = 3;</code>
- *
- * <pre>
- * 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.
- * </pre>
- */
- boolean hasPublicKey();
- /**
- * <code>optional bytes public_key = 3;</code>
- *
- * <pre>
- * 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.
- * </pre>
- */
- com.google.protobuf.ByteString getPublicKey();
- // optional string label = 4;
- /**
- * <code>optional string label = 4;</code>
- *
- * <pre>
- * User-provided label associated with the key.
- * </pre>
- */
- boolean hasLabel();
- /**
- * <code>optional string label = 4;</code>
- *
- * <pre>
- * User-provided label associated with the key.
- * </pre>
- */
- java.lang.String getLabel();
- /**
- * <code>optional string label = 4;</code>
- *
- * <pre>
- * User-provided label associated with the key.
- * </pre>
- */
- com.google.protobuf.ByteString
- getLabelBytes();
- // optional int64 creation_timestamp = 5;
- /**
- * <code>optional int64 creation_timestamp = 5;</code>
- *
- * <pre>
- * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
- * </pre>
- */
- boolean hasCreationTimestamp();
- /**
- * <code>optional int64 creation_timestamp = 5;</code>
- *
- * <pre>
- * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
- * </pre>
- */
- long getCreationTimestamp();
- }
- /**
- * Protobuf type {@code wallet.Key}
- *
- * <pre>
- **
- * 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.
- * </pre>
- */
- public static final class Key extends
- com.google.protobuf.GeneratedMessage
- implements KeyOrBuilder {
- // Use Key.newBuilder() to construct.
- private Key(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
- super(builder);
- this.unknownFields = builder.getUnknownFields();
- }
- private Key(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
- private static final Key defaultInstance;
- public static Key getDefaultInstance() {
- return defaultInstance;
- }
- public Key getDefaultInstanceForType() {
- return defaultInstance;
- }
- private final com.google.protobuf.UnknownFieldSet unknownFields;
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- private Key(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- initFields();
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- case 8: {
- int rawValue = input.readEnum();
- org.bitcoinj.wallet.Protos.Key.Type value = org.bitcoinj.wallet.Protos.Key.Type.valueOf(rawValue);
- if (value == null) {
- unknownFields.mergeVarintField(1, rawValue);
- } else {
- bitField0_ |= 0x00000001;
- type_ = value;
- }
- break;
- }
- case 18: {
- bitField0_ |= 0x00000002;
- privateKey_ = input.readBytes();
- break;
- }
- case 26: {
- bitField0_ |= 0x00000008;
- publicKey_ = input.readBytes();
- break;
- }
- case 34: {
- bitField0_ |= 0x00000010;
- label_ = input.readBytes();
- break;
- }
- case 40: {
- bitField0_ |= 0x00000020;
- creationTimestamp_ = input.readInt64();
- break;
- }
- case 50: {
- org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder subBuilder = null;
- if (((bitField0_ & 0x00000004) == 0x00000004)) {
- subBuilder = encryptedPrivateKey_.toBuilder();
- }
- encryptedPrivateKey_ = input.readMessage(org.bitcoinj.wallet.Protos.EncryptedPrivateKey.PARSER, extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(encryptedPrivateKey_);
- encryptedPrivateKey_ = subBuilder.buildPartial();
- }
- bitField0_ |= 0x00000004;
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e.getMessage()).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor;
- }
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- org.bitcoinj.wallet.Protos.Key.class, org.bitcoinj.wallet.Protos.Key.Builder.class);
- }
- public static com.google.protobuf.Parser<Key> PARSER =
- new com.google.protobuf.AbstractParser<Key>() {
- public Key parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return new Key(input, extensionRegistry);
- }
- };
- @java.lang.Override
- public com.google.protobuf.Parser<Key> getParserForType() {
- return PARSER;
- }
- /**
- * Protobuf enum {@code wallet.Key.Type}
- */
- public enum Type
- implements com.google.protobuf.ProtocolMessageEnum {
- /**
- * <code>ORIGINAL = 1;</code>
- *
- * <pre>
- * Unencrypted - Original bitcoin secp256k1 curve
- * </pre>
- */
- ORIGINAL(0, 1),
- /**
- * <code>ENCRYPTED_SCRYPT_AES = 2;</code>
- *
- * <pre>
- * Encrypted with Scrypt and AES - - Original bitcoin secp256k1 curve
- * </pre>
- */
- ENCRYPTED_SCRYPT_AES(1, 2),
- ;
- /**
- * <code>ORIGINAL = 1;</code>
- *
- * <pre>
- * Unencrypted - Original bitcoin secp256k1 curve
- * </pre>
- */
- public static final int ORIGINAL_VALUE = 1;
- /**
- * <code>ENCRYPTED_SCRYPT_AES = 2;</code>
- *
- * <pre>
- * Encrypted with Scrypt and AES - - Original bitcoin secp256k1 curve
- * </pre>
- */
- public static final int ENCRYPTED_SCRYPT_AES_VALUE = 2;
- public final int getNumber() { return value; }
- public static Type valueOf(int value) {
- switch (value) {
- case 1: return ORIGINAL;
- case 2: return ENCRYPTED_SCRYPT_AES;
- default: return null;
- }
- }
- public static com.google.protobuf.Internal.EnumLiteMap<Type>
- internalGetValueMap() {
- return internalValueMap;…