public Builder clear() { super.clear(); type_ = com.openwallet.core.protos.Protos.Key.Type.ORIGINAL; bitField0_ = (bitField0_ & ~0x00000001); secretBytes_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000002); if (encryptedDataBuilder_ == null) { encryptedData_ = com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance(); } else { encryptedDataBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); publicKey_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000008); label_ = ""; bitField0_ = (bitField0_ & ~0x00000010); if (deterministicKeyBuilder_ == null) { deterministicKey_ = com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance(); } else { deterministicKeyBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); return this; }
if (key.hasEncryptedData()) { Protos.EncryptedData proto = key.getEncryptedData(); EncryptedData data = new EncryptedData(proto.getInitialisationVector().toByteArray(), proto.getEncryptedPrivateKey().toByteArray()); checkNotNull(crypter, "Encountered an encrypted key but no key crypter provided"); detkey = new DeterministicKey(immutablePath, chainCode, crypter, pubkey, data, parent);
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); }
seed = new DeterministicSeed(new byte[16], mnemonic, 0); } else if (key.hasEncryptedData()) { EncryptedData data = new EncryptedData(key.getEncryptedData().getInitialisationVector().toByteArray(), key.getEncryptedData().getEncryptedPrivateKey().toByteArray()); seed = new DeterministicSeed(data, null, 0); } else {
com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasType()) { memoizedIsInitialized = 0; return false; } if (hasEncryptedData()) { if (!getEncryptedData().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasDeterministicKey()) { if (!getDeterministicKey().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
/** * <code>optional .com.openwallet.core.protos.EncryptedData encrypted_data = 3;</code> * * <pre> * If the secret data is encrypted, then secret_bytes is missing and this field is set. * </pre> */ public Builder mergeEncryptedData(com.openwallet.core.protos.Protos.EncryptedData value) { if (encryptedDataBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && encryptedData_ != com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance()) { encryptedData_ = com.openwallet.core.protos.Protos.EncryptedData.newBuilder(encryptedData_).mergeFrom(value).buildPartial(); } else { encryptedData_ = value; } onChanged(); } else { encryptedDataBuilder_.mergeFrom(value); } bitField0_ |= 0x00000004; return this; } /**
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; }
/** * <code>optional .com.openwallet.core.protos.EncryptedData encrypted_data = 3;</code> * * <pre> * If the secret data is encrypted, then secret_bytes is missing and this field is set. * </pre> */ public Builder clearEncryptedData() { if (encryptedDataBuilder_ == null) { encryptedData_ = com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance(); onChanged(); } else { encryptedDataBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); return this; } /**
public com.openwallet.core.protos.Protos.EncryptedData buildPartial() { com.openwallet.core.protos.Protos.EncryptedData result = new com.openwallet.core.protos.Protos.EncryptedData(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 final boolean isInitialized() { if (!hasType()) { return false; } if (hasEncryptedData()) { if (!getEncryptedData().isInitialized()) { return false; } } if (hasDeterministicKey()) { if (!getDeterministicKey().isInitialized()) { return false; } } return true; }
public com.openwallet.core.protos.Protos.EncryptedData getDefaultInstanceForType() { return com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance(); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasInitialisationVector()) { memoizedIsInitialized = 0; return false; } if (!hasEncryptedPrivateKey()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
/** * <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; }
/** * <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; }
private void initFields() { type_ = com.openwallet.core.protos.Protos.Key.Type.ORIGINAL; secretBytes_ = com.google.protobuf.ByteString.EMPTY; encryptedData_ = com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance(); publicKey_ = com.google.protobuf.ByteString.EMPTY; label_ = ""; deterministicKey_ = com.openwallet.core.protos.Protos.DeterministicKey.getDefaultInstance(); } private byte memoizedIsInitialized = -1;
public com.openwallet.core.protos.Protos.EncryptedData build() { com.openwallet.core.protos.Protos.EncryptedData result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public Builder mergeFrom(com.openwallet.core.protos.Protos.EncryptedData other) { if (other == com.openwallet.core.protos.Protos.EncryptedData.getDefaultInstance()) return this; if (other.hasInitialisationVector()) { setInitialisationVector(other.getInitialisationVector()); } if (other.hasEncryptedPrivateKey()) { setEncryptedPrivateKey(other.getEncryptedPrivateKey()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }