297 lines
7.8 KiB
JavaScript
297 lines
7.8 KiB
JavaScript
/**
|
|
* @fileoverview
|
|
* @enhanceable
|
|
* @suppress {messageConventions} JS Compiler reports an error if a variable or
|
|
* field starts with 'MSG_' and isn't a translatable message.
|
|
* @public
|
|
*/
|
|
// GENERATED CODE -- DO NOT EDIT!
|
|
|
|
var jspb = require('google-protobuf');
|
|
var goog = jspb;
|
|
var global = Function('return this')();
|
|
|
|
goog.exportSymbol('proto.pb.Certificate', null, global);
|
|
goog.exportSymbol('proto.pb.Certificate.Version', null, global);
|
|
goog.exportSymbol('proto.pb.KeyType', null, global);
|
|
|
|
/**
|
|
* Generated by JsPbCodeGenerator.
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
* valid.
|
|
* @extends {jspb.Message}
|
|
* @constructor
|
|
*/
|
|
proto.pb.Certificate = function(opt_data) {
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
};
|
|
goog.inherits(proto.pb.Certificate, jspb.Message);
|
|
if (goog.DEBUG && !COMPILED) {
|
|
proto.pb.Certificate.displayName = 'proto.pb.Certificate';
|
|
}
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
/**
|
|
* Creates an object representation of this proto suitable for use in Soy templates.
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
* For the list of reserved names please see:
|
|
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
|
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
|
* for transitional soy proto support: http://goto/soy-param-migration
|
|
* @return {!Object}
|
|
*/
|
|
proto.pb.Certificate.prototype.toObject = function(opt_includeInstance) {
|
|
return proto.pb.Certificate.toObject(opt_includeInstance, this);
|
|
};
|
|
|
|
|
|
/**
|
|
* Static version of the {@see toObject} method.
|
|
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
|
* instance for transitional soy proto support:
|
|
* http://goto/soy-param-migration
|
|
* @param {!proto.pb.Certificate} msg The msg instance to transform.
|
|
* @return {!Object}
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.pb.Certificate.toObject = function(includeInstance, msg) {
|
|
var f, obj = {
|
|
version: jspb.Message.getField(msg, 1),
|
|
keytype: jspb.Message.getField(msg, 2),
|
|
publickey: msg.getPublickey_asB64()
|
|
};
|
|
|
|
if (includeInstance) {
|
|
obj.$jspbMessageInstance = msg;
|
|
}
|
|
return obj;
|
|
};
|
|
}
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format).
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
* @return {!proto.pb.Certificate}
|
|
*/
|
|
proto.pb.Certificate.deserializeBinary = function(bytes) {
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
var msg = new proto.pb.Certificate;
|
|
return proto.pb.Certificate.deserializeBinaryFromReader(msg, reader);
|
|
};
|
|
|
|
|
|
/**
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
* given reader into the given message object.
|
|
* @param {!proto.pb.Certificate} msg The message object to deserialize into.
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
* @return {!proto.pb.Certificate}
|
|
*/
|
|
proto.pb.Certificate.deserializeBinaryFromReader = function(msg, reader) {
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup()) {
|
|
break;
|
|
}
|
|
var field = reader.getFieldNumber();
|
|
switch (field) {
|
|
case 1:
|
|
var value = /** @type {!proto.pb.Certificate.Version} */ (reader.readEnum());
|
|
msg.setVersion(value);
|
|
break;
|
|
case 2:
|
|
var value = /** @type {!proto.pb.KeyType} */ (reader.readEnum());
|
|
msg.setKeytype(value);
|
|
break;
|
|
case 4:
|
|
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
msg.setPublickey(value);
|
|
break;
|
|
default:
|
|
reader.skipField();
|
|
break;
|
|
}
|
|
}
|
|
return msg;
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
* @return {!Uint8Array}
|
|
*/
|
|
proto.pb.Certificate.prototype.serializeBinary = function() {
|
|
var writer = new jspb.BinaryWriter();
|
|
proto.pb.Certificate.serializeBinaryToWriter(this, writer);
|
|
return writer.getResultBuffer();
|
|
};
|
|
|
|
|
|
/**
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
* format), writing to the given BinaryWriter.
|
|
* @param {!proto.pb.Certificate} message
|
|
* @param {!jspb.BinaryWriter} writer
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
*/
|
|
proto.pb.Certificate.serializeBinaryToWriter = function(message, writer) {
|
|
var f = undefined;
|
|
f = /** @type {!proto.pb.Certificate.Version} */ (jspb.Message.getField(message, 1));
|
|
if (f != null) {
|
|
writer.writeEnum(
|
|
1,
|
|
f
|
|
);
|
|
}
|
|
f = /** @type {!proto.pb.KeyType} */ (jspb.Message.getField(message, 2));
|
|
if (f != null) {
|
|
writer.writeEnum(
|
|
2,
|
|
f
|
|
);
|
|
}
|
|
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 4));
|
|
if (f != null) {
|
|
writer.writeBytes(
|
|
4,
|
|
f
|
|
);
|
|
}
|
|
};
|
|
|
|
|
|
/**
|
|
* @enum {number}
|
|
*/
|
|
proto.pb.Certificate.Version = {
|
|
UNKNOWN_VERSION: 0,
|
|
_0_0_1: 1
|
|
};
|
|
|
|
/**
|
|
* required Version version = 1;
|
|
* @return {!proto.pb.Certificate.Version}
|
|
*/
|
|
proto.pb.Certificate.prototype.getVersion = function() {
|
|
return /** @type {!proto.pb.Certificate.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
|
|
};
|
|
|
|
|
|
/** @param {!proto.pb.Certificate.Version} value */
|
|
proto.pb.Certificate.prototype.setVersion = function(value) {
|
|
jspb.Message.setField(this, 1, value);
|
|
};
|
|
|
|
|
|
proto.pb.Certificate.prototype.clearVersion = function() {
|
|
jspb.Message.setField(this, 1, undefined);
|
|
};
|
|
|
|
|
|
/**
|
|
* Returns whether this field is set.
|
|
* @return {!boolean}
|
|
*/
|
|
proto.pb.Certificate.prototype.hasVersion = function() {
|
|
return jspb.Message.getField(this, 1) != null;
|
|
};
|
|
|
|
|
|
/**
|
|
* required KeyType keyType = 2;
|
|
* @return {!proto.pb.KeyType}
|
|
*/
|
|
proto.pb.Certificate.prototype.getKeytype = function() {
|
|
return /** @type {!proto.pb.KeyType} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
|
|
};
|
|
|
|
|
|
/** @param {!proto.pb.KeyType} value */
|
|
proto.pb.Certificate.prototype.setKeytype = function(value) {
|
|
jspb.Message.setField(this, 2, value);
|
|
};
|
|
|
|
|
|
proto.pb.Certificate.prototype.clearKeytype = function() {
|
|
jspb.Message.setField(this, 2, undefined);
|
|
};
|
|
|
|
|
|
/**
|
|
* Returns whether this field is set.
|
|
* @return {!boolean}
|
|
*/
|
|
proto.pb.Certificate.prototype.hasKeytype = function() {
|
|
return jspb.Message.getField(this, 2) != null;
|
|
};
|
|
|
|
|
|
/**
|
|
* required bytes publicKey = 4;
|
|
* @return {!(string|Uint8Array)}
|
|
*/
|
|
proto.pb.Certificate.prototype.getPublickey = function() {
|
|
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
|
};
|
|
|
|
|
|
/**
|
|
* required bytes publicKey = 4;
|
|
* This is a type-conversion wrapper around `getPublickey()`
|
|
* @return {string}
|
|
*/
|
|
proto.pb.Certificate.prototype.getPublickey_asB64 = function() {
|
|
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
|
this.getPublickey()));
|
|
};
|
|
|
|
|
|
/**
|
|
* required bytes publicKey = 4;
|
|
* Note that Uint8Array is not supported on all browsers.
|
|
* @see http://caniuse.com/Uint8Array
|
|
* This is a type-conversion wrapper around `getPublickey()`
|
|
* @return {!Uint8Array}
|
|
*/
|
|
proto.pb.Certificate.prototype.getPublickey_asU8 = function() {
|
|
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
|
this.getPublickey()));
|
|
};
|
|
|
|
|
|
/** @param {!(string|Uint8Array)} value */
|
|
proto.pb.Certificate.prototype.setPublickey = function(value) {
|
|
jspb.Message.setField(this, 4, value);
|
|
};
|
|
|
|
|
|
proto.pb.Certificate.prototype.clearPublickey = function() {
|
|
jspb.Message.setField(this, 4, undefined);
|
|
};
|
|
|
|
|
|
/**
|
|
* Returns whether this field is set.
|
|
* @return {!boolean}
|
|
*/
|
|
proto.pb.Certificate.prototype.hasPublickey = function() {
|
|
return jspb.Message.getField(this, 4) != null;
|
|
};
|
|
|
|
|
|
/**
|
|
* @enum {number}
|
|
*/
|
|
proto.pb.KeyType = {
|
|
UNKNOWN_PUBLIC_KEY_TYPE: 0,
|
|
NIST256P: 1,
|
|
NIST384P: 2,
|
|
SECP256K1: 3
|
|
};
|
|
|
|
goog.object.extend(exports, proto.pb);
|