github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/proto/crypto_pb.js (about) 1 // source: crypto.proto 2 /** 3 * @fileoverview 4 * @enhanceable 5 * @suppress {missingRequire} reports error on implicit type usages. 6 * @suppress {messageConventions} JS Compiler reports an error if a variable or 7 * field starts with 'MSG_' and isn't a translatable message. 8 * @public 9 */ 10 // GENERATED CODE -- DO NOT EDIT! 11 /* eslint-disable */ 12 // @ts-nocheck 13 14 var jspb = require('google-protobuf'); 15 var goog = jspb; 16 var global = Function('return this')(); 17 18 var gogoproto_gogo_pb = require('./gogoproto/gogo_pb.js'); 19 goog.object.extend(proto, gogoproto_gogo_pb); 20 goog.exportSymbol('proto.crypto.PrivateKey', null, global); 21 goog.exportSymbol('proto.crypto.PublicKey', null, global); 22 goog.exportSymbol('proto.crypto.Signature', null, global); 23 /** 24 * Generated by JsPbCodeGenerator. 25 * @param {Array=} opt_data Optional initial data array, typically from a 26 * server response, or constructed directly in Javascript. The array is used 27 * in place and becomes part of the constructed object. It is not cloned. 28 * If no data is provided, the constructed object will be empty, but still 29 * valid. 30 * @extends {jspb.Message} 31 * @constructor 32 */ 33 proto.crypto.PublicKey = function(opt_data) { 34 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 35 }; 36 goog.inherits(proto.crypto.PublicKey, jspb.Message); 37 if (goog.DEBUG && !COMPILED) { 38 /** 39 * @public 40 * @override 41 */ 42 proto.crypto.PublicKey.displayName = 'proto.crypto.PublicKey'; 43 } 44 /** 45 * Generated by JsPbCodeGenerator. 46 * @param {Array=} opt_data Optional initial data array, typically from a 47 * server response, or constructed directly in Javascript. The array is used 48 * in place and becomes part of the constructed object. It is not cloned. 49 * If no data is provided, the constructed object will be empty, but still 50 * valid. 51 * @extends {jspb.Message} 52 * @constructor 53 */ 54 proto.crypto.PrivateKey = function(opt_data) { 55 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 56 }; 57 goog.inherits(proto.crypto.PrivateKey, jspb.Message); 58 if (goog.DEBUG && !COMPILED) { 59 /** 60 * @public 61 * @override 62 */ 63 proto.crypto.PrivateKey.displayName = 'proto.crypto.PrivateKey'; 64 } 65 /** 66 * Generated by JsPbCodeGenerator. 67 * @param {Array=} opt_data Optional initial data array, typically from a 68 * server response, or constructed directly in Javascript. The array is used 69 * in place and becomes part of the constructed object. It is not cloned. 70 * If no data is provided, the constructed object will be empty, but still 71 * valid. 72 * @extends {jspb.Message} 73 * @constructor 74 */ 75 proto.crypto.Signature = function(opt_data) { 76 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 77 }; 78 goog.inherits(proto.crypto.Signature, jspb.Message); 79 if (goog.DEBUG && !COMPILED) { 80 /** 81 * @public 82 * @override 83 */ 84 proto.crypto.Signature.displayName = 'proto.crypto.Signature'; 85 } 86 87 88 89 if (jspb.Message.GENERATE_TO_OBJECT) { 90 /** 91 * Creates an object representation of this proto. 92 * Field names that are reserved in JavaScript and will be renamed to pb_name. 93 * Optional fields that are not set will be set to undefined. 94 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 95 * For the list of reserved names please see: 96 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 97 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 98 * JSPB instance for transitional soy proto support: 99 * http://goto/soy-param-migration 100 * @return {!Object} 101 */ 102 proto.crypto.PublicKey.prototype.toObject = function(opt_includeInstance) { 103 return proto.crypto.PublicKey.toObject(opt_includeInstance, this); 104 }; 105 106 107 /** 108 * Static version of the {@see toObject} method. 109 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 110 * the JSPB instance for transitional soy proto support: 111 * http://goto/soy-param-migration 112 * @param {!proto.crypto.PublicKey} msg The msg instance to transform. 113 * @return {!Object} 114 * @suppress {unusedLocalVariables} f is only used for nested messages 115 */ 116 proto.crypto.PublicKey.toObject = function(includeInstance, msg) { 117 var f, obj = { 118 curvetype: jspb.Message.getFieldWithDefault(msg, 1, 0), 119 publickey: msg.getPublickey_asB64() 120 }; 121 122 if (includeInstance) { 123 obj.$jspbMessageInstance = msg; 124 } 125 return obj; 126 }; 127 } 128 129 130 /** 131 * Deserializes binary data (in protobuf wire format). 132 * @param {jspb.ByteSource} bytes The bytes to deserialize. 133 * @return {!proto.crypto.PublicKey} 134 */ 135 proto.crypto.PublicKey.deserializeBinary = function(bytes) { 136 var reader = new jspb.BinaryReader(bytes); 137 var msg = new proto.crypto.PublicKey; 138 return proto.crypto.PublicKey.deserializeBinaryFromReader(msg, reader); 139 }; 140 141 142 /** 143 * Deserializes binary data (in protobuf wire format) from the 144 * given reader into the given message object. 145 * @param {!proto.crypto.PublicKey} msg The message object to deserialize into. 146 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 147 * @return {!proto.crypto.PublicKey} 148 */ 149 proto.crypto.PublicKey.deserializeBinaryFromReader = function(msg, reader) { 150 while (reader.nextField()) { 151 if (reader.isEndGroup()) { 152 break; 153 } 154 var field = reader.getFieldNumber(); 155 switch (field) { 156 case 1: 157 var value = /** @type {number} */ (reader.readUint32()); 158 msg.setCurvetype(value); 159 break; 160 case 2: 161 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 162 msg.setPublickey(value); 163 break; 164 default: 165 reader.skipField(); 166 break; 167 } 168 } 169 return msg; 170 }; 171 172 173 /** 174 * Serializes the message to binary data (in protobuf wire format). 175 * @return {!Uint8Array} 176 */ 177 proto.crypto.PublicKey.prototype.serializeBinary = function() { 178 var writer = new jspb.BinaryWriter(); 179 proto.crypto.PublicKey.serializeBinaryToWriter(this, writer); 180 return writer.getResultBuffer(); 181 }; 182 183 184 /** 185 * Serializes the given message to binary data (in protobuf wire 186 * format), writing to the given BinaryWriter. 187 * @param {!proto.crypto.PublicKey} message 188 * @param {!jspb.BinaryWriter} writer 189 * @suppress {unusedLocalVariables} f is only used for nested messages 190 */ 191 proto.crypto.PublicKey.serializeBinaryToWriter = function(message, writer) { 192 var f = undefined; 193 f = message.getCurvetype(); 194 if (f !== 0) { 195 writer.writeUint32( 196 1, 197 f 198 ); 199 } 200 f = message.getPublickey_asU8(); 201 if (f.length > 0) { 202 writer.writeBytes( 203 2, 204 f 205 ); 206 } 207 }; 208 209 210 /** 211 * optional uint32 CurveType = 1; 212 * @return {number} 213 */ 214 proto.crypto.PublicKey.prototype.getCurvetype = function() { 215 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); 216 }; 217 218 219 /** 220 * @param {number} value 221 * @return {!proto.crypto.PublicKey} returns this 222 */ 223 proto.crypto.PublicKey.prototype.setCurvetype = function(value) { 224 return jspb.Message.setProto3IntField(this, 1, value); 225 }; 226 227 228 /** 229 * optional bytes PublicKey = 2; 230 * @return {!(string|Uint8Array)} 231 */ 232 proto.crypto.PublicKey.prototype.getPublickey = function() { 233 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 234 }; 235 236 237 /** 238 * optional bytes PublicKey = 2; 239 * This is a type-conversion wrapper around `getPublickey()` 240 * @return {string} 241 */ 242 proto.crypto.PublicKey.prototype.getPublickey_asB64 = function() { 243 return /** @type {string} */ (jspb.Message.bytesAsB64( 244 this.getPublickey())); 245 }; 246 247 248 /** 249 * optional bytes PublicKey = 2; 250 * Note that Uint8Array is not supported on all browsers. 251 * @see http://caniuse.com/Uint8Array 252 * This is a type-conversion wrapper around `getPublickey()` 253 * @return {!Uint8Array} 254 */ 255 proto.crypto.PublicKey.prototype.getPublickey_asU8 = function() { 256 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 257 this.getPublickey())); 258 }; 259 260 261 /** 262 * @param {!(string|Uint8Array)} value 263 * @return {!proto.crypto.PublicKey} returns this 264 */ 265 proto.crypto.PublicKey.prototype.setPublickey = function(value) { 266 return jspb.Message.setProto3BytesField(this, 2, value); 267 }; 268 269 270 271 272 273 if (jspb.Message.GENERATE_TO_OBJECT) { 274 /** 275 * Creates an object representation of this proto. 276 * Field names that are reserved in JavaScript and will be renamed to pb_name. 277 * Optional fields that are not set will be set to undefined. 278 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 279 * For the list of reserved names please see: 280 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 281 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 282 * JSPB instance for transitional soy proto support: 283 * http://goto/soy-param-migration 284 * @return {!Object} 285 */ 286 proto.crypto.PrivateKey.prototype.toObject = function(opt_includeInstance) { 287 return proto.crypto.PrivateKey.toObject(opt_includeInstance, this); 288 }; 289 290 291 /** 292 * Static version of the {@see toObject} method. 293 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 294 * the JSPB instance for transitional soy proto support: 295 * http://goto/soy-param-migration 296 * @param {!proto.crypto.PrivateKey} msg The msg instance to transform. 297 * @return {!Object} 298 * @suppress {unusedLocalVariables} f is only used for nested messages 299 */ 300 proto.crypto.PrivateKey.toObject = function(includeInstance, msg) { 301 var f, obj = { 302 curvetype: jspb.Message.getFieldWithDefault(msg, 1, 0), 303 publickey: msg.getPublickey_asB64(), 304 privatekey: msg.getPrivatekey_asB64() 305 }; 306 307 if (includeInstance) { 308 obj.$jspbMessageInstance = msg; 309 } 310 return obj; 311 }; 312 } 313 314 315 /** 316 * Deserializes binary data (in protobuf wire format). 317 * @param {jspb.ByteSource} bytes The bytes to deserialize. 318 * @return {!proto.crypto.PrivateKey} 319 */ 320 proto.crypto.PrivateKey.deserializeBinary = function(bytes) { 321 var reader = new jspb.BinaryReader(bytes); 322 var msg = new proto.crypto.PrivateKey; 323 return proto.crypto.PrivateKey.deserializeBinaryFromReader(msg, reader); 324 }; 325 326 327 /** 328 * Deserializes binary data (in protobuf wire format) from the 329 * given reader into the given message object. 330 * @param {!proto.crypto.PrivateKey} msg The message object to deserialize into. 331 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 332 * @return {!proto.crypto.PrivateKey} 333 */ 334 proto.crypto.PrivateKey.deserializeBinaryFromReader = function(msg, reader) { 335 while (reader.nextField()) { 336 if (reader.isEndGroup()) { 337 break; 338 } 339 var field = reader.getFieldNumber(); 340 switch (field) { 341 case 1: 342 var value = /** @type {number} */ (reader.readUint32()); 343 msg.setCurvetype(value); 344 break; 345 case 2: 346 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 347 msg.setPublickey(value); 348 break; 349 case 3: 350 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 351 msg.setPrivatekey(value); 352 break; 353 default: 354 reader.skipField(); 355 break; 356 } 357 } 358 return msg; 359 }; 360 361 362 /** 363 * Serializes the message to binary data (in protobuf wire format). 364 * @return {!Uint8Array} 365 */ 366 proto.crypto.PrivateKey.prototype.serializeBinary = function() { 367 var writer = new jspb.BinaryWriter(); 368 proto.crypto.PrivateKey.serializeBinaryToWriter(this, writer); 369 return writer.getResultBuffer(); 370 }; 371 372 373 /** 374 * Serializes the given message to binary data (in protobuf wire 375 * format), writing to the given BinaryWriter. 376 * @param {!proto.crypto.PrivateKey} message 377 * @param {!jspb.BinaryWriter} writer 378 * @suppress {unusedLocalVariables} f is only used for nested messages 379 */ 380 proto.crypto.PrivateKey.serializeBinaryToWriter = function(message, writer) { 381 var f = undefined; 382 f = message.getCurvetype(); 383 if (f !== 0) { 384 writer.writeUint32( 385 1, 386 f 387 ); 388 } 389 f = message.getPublickey_asU8(); 390 if (f.length > 0) { 391 writer.writeBytes( 392 2, 393 f 394 ); 395 } 396 f = message.getPrivatekey_asU8(); 397 if (f.length > 0) { 398 writer.writeBytes( 399 3, 400 f 401 ); 402 } 403 }; 404 405 406 /** 407 * optional uint32 CurveType = 1; 408 * @return {number} 409 */ 410 proto.crypto.PrivateKey.prototype.getCurvetype = function() { 411 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); 412 }; 413 414 415 /** 416 * @param {number} value 417 * @return {!proto.crypto.PrivateKey} returns this 418 */ 419 proto.crypto.PrivateKey.prototype.setCurvetype = function(value) { 420 return jspb.Message.setProto3IntField(this, 1, value); 421 }; 422 423 424 /** 425 * optional bytes PublicKey = 2; 426 * @return {!(string|Uint8Array)} 427 */ 428 proto.crypto.PrivateKey.prototype.getPublickey = function() { 429 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 430 }; 431 432 433 /** 434 * optional bytes PublicKey = 2; 435 * This is a type-conversion wrapper around `getPublickey()` 436 * @return {string} 437 */ 438 proto.crypto.PrivateKey.prototype.getPublickey_asB64 = function() { 439 return /** @type {string} */ (jspb.Message.bytesAsB64( 440 this.getPublickey())); 441 }; 442 443 444 /** 445 * optional bytes PublicKey = 2; 446 * Note that Uint8Array is not supported on all browsers. 447 * @see http://caniuse.com/Uint8Array 448 * This is a type-conversion wrapper around `getPublickey()` 449 * @return {!Uint8Array} 450 */ 451 proto.crypto.PrivateKey.prototype.getPublickey_asU8 = function() { 452 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 453 this.getPublickey())); 454 }; 455 456 457 /** 458 * @param {!(string|Uint8Array)} value 459 * @return {!proto.crypto.PrivateKey} returns this 460 */ 461 proto.crypto.PrivateKey.prototype.setPublickey = function(value) { 462 return jspb.Message.setProto3BytesField(this, 2, value); 463 }; 464 465 466 /** 467 * optional bytes PrivateKey = 3; 468 * @return {!(string|Uint8Array)} 469 */ 470 proto.crypto.PrivateKey.prototype.getPrivatekey = function() { 471 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); 472 }; 473 474 475 /** 476 * optional bytes PrivateKey = 3; 477 * This is a type-conversion wrapper around `getPrivatekey()` 478 * @return {string} 479 */ 480 proto.crypto.PrivateKey.prototype.getPrivatekey_asB64 = function() { 481 return /** @type {string} */ (jspb.Message.bytesAsB64( 482 this.getPrivatekey())); 483 }; 484 485 486 /** 487 * optional bytes PrivateKey = 3; 488 * Note that Uint8Array is not supported on all browsers. 489 * @see http://caniuse.com/Uint8Array 490 * This is a type-conversion wrapper around `getPrivatekey()` 491 * @return {!Uint8Array} 492 */ 493 proto.crypto.PrivateKey.prototype.getPrivatekey_asU8 = function() { 494 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 495 this.getPrivatekey())); 496 }; 497 498 499 /** 500 * @param {!(string|Uint8Array)} value 501 * @return {!proto.crypto.PrivateKey} returns this 502 */ 503 proto.crypto.PrivateKey.prototype.setPrivatekey = function(value) { 504 return jspb.Message.setProto3BytesField(this, 3, value); 505 }; 506 507 508 509 510 511 if (jspb.Message.GENERATE_TO_OBJECT) { 512 /** 513 * Creates an object representation of this proto. 514 * Field names that are reserved in JavaScript and will be renamed to pb_name. 515 * Optional fields that are not set will be set to undefined. 516 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 517 * For the list of reserved names please see: 518 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 519 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 520 * JSPB instance for transitional soy proto support: 521 * http://goto/soy-param-migration 522 * @return {!Object} 523 */ 524 proto.crypto.Signature.prototype.toObject = function(opt_includeInstance) { 525 return proto.crypto.Signature.toObject(opt_includeInstance, this); 526 }; 527 528 529 /** 530 * Static version of the {@see toObject} method. 531 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 532 * the JSPB instance for transitional soy proto support: 533 * http://goto/soy-param-migration 534 * @param {!proto.crypto.Signature} msg The msg instance to transform. 535 * @return {!Object} 536 * @suppress {unusedLocalVariables} f is only used for nested messages 537 */ 538 proto.crypto.Signature.toObject = function(includeInstance, msg) { 539 var f, obj = { 540 curvetype: jspb.Message.getFieldWithDefault(msg, 1, 0), 541 signature: msg.getSignature_asB64() 542 }; 543 544 if (includeInstance) { 545 obj.$jspbMessageInstance = msg; 546 } 547 return obj; 548 }; 549 } 550 551 552 /** 553 * Deserializes binary data (in protobuf wire format). 554 * @param {jspb.ByteSource} bytes The bytes to deserialize. 555 * @return {!proto.crypto.Signature} 556 */ 557 proto.crypto.Signature.deserializeBinary = function(bytes) { 558 var reader = new jspb.BinaryReader(bytes); 559 var msg = new proto.crypto.Signature; 560 return proto.crypto.Signature.deserializeBinaryFromReader(msg, reader); 561 }; 562 563 564 /** 565 * Deserializes binary data (in protobuf wire format) from the 566 * given reader into the given message object. 567 * @param {!proto.crypto.Signature} msg The message object to deserialize into. 568 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 569 * @return {!proto.crypto.Signature} 570 */ 571 proto.crypto.Signature.deserializeBinaryFromReader = function(msg, reader) { 572 while (reader.nextField()) { 573 if (reader.isEndGroup()) { 574 break; 575 } 576 var field = reader.getFieldNumber(); 577 switch (field) { 578 case 1: 579 var value = /** @type {number} */ (reader.readUint32()); 580 msg.setCurvetype(value); 581 break; 582 case 2: 583 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 584 msg.setSignature(value); 585 break; 586 default: 587 reader.skipField(); 588 break; 589 } 590 } 591 return msg; 592 }; 593 594 595 /** 596 * Serializes the message to binary data (in protobuf wire format). 597 * @return {!Uint8Array} 598 */ 599 proto.crypto.Signature.prototype.serializeBinary = function() { 600 var writer = new jspb.BinaryWriter(); 601 proto.crypto.Signature.serializeBinaryToWriter(this, writer); 602 return writer.getResultBuffer(); 603 }; 604 605 606 /** 607 * Serializes the given message to binary data (in protobuf wire 608 * format), writing to the given BinaryWriter. 609 * @param {!proto.crypto.Signature} message 610 * @param {!jspb.BinaryWriter} writer 611 * @suppress {unusedLocalVariables} f is only used for nested messages 612 */ 613 proto.crypto.Signature.serializeBinaryToWriter = function(message, writer) { 614 var f = undefined; 615 f = message.getCurvetype(); 616 if (f !== 0) { 617 writer.writeUint32( 618 1, 619 f 620 ); 621 } 622 f = message.getSignature_asU8(); 623 if (f.length > 0) { 624 writer.writeBytes( 625 2, 626 f 627 ); 628 } 629 }; 630 631 632 /** 633 * optional uint32 CurveType = 1; 634 * @return {number} 635 */ 636 proto.crypto.Signature.prototype.getCurvetype = function() { 637 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); 638 }; 639 640 641 /** 642 * @param {number} value 643 * @return {!proto.crypto.Signature} returns this 644 */ 645 proto.crypto.Signature.prototype.setCurvetype = function(value) { 646 return jspb.Message.setProto3IntField(this, 1, value); 647 }; 648 649 650 /** 651 * optional bytes Signature = 2; 652 * @return {!(string|Uint8Array)} 653 */ 654 proto.crypto.Signature.prototype.getSignature = function() { 655 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 656 }; 657 658 659 /** 660 * optional bytes Signature = 2; 661 * This is a type-conversion wrapper around `getSignature()` 662 * @return {string} 663 */ 664 proto.crypto.Signature.prototype.getSignature_asB64 = function() { 665 return /** @type {string} */ (jspb.Message.bytesAsB64( 666 this.getSignature())); 667 }; 668 669 670 /** 671 * optional bytes Signature = 2; 672 * Note that Uint8Array is not supported on all browsers. 673 * @see http://caniuse.com/Uint8Array 674 * This is a type-conversion wrapper around `getSignature()` 675 * @return {!Uint8Array} 676 */ 677 proto.crypto.Signature.prototype.getSignature_asU8 = function() { 678 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 679 this.getSignature())); 680 }; 681 682 683 /** 684 * @param {!(string|Uint8Array)} value 685 * @return {!proto.crypto.Signature} returns this 686 */ 687 proto.crypto.Signature.prototype.setSignature = function(value) { 688 return jspb.Message.setProto3BytesField(this, 2, value); 689 }; 690 691 692 goog.object.extend(exports, proto.crypto);