@xyo-network/signing
Advanced tools
Comparing version 0.8.3 to 0.9.0
@@ -29,3 +29,3 @@ /// <reference types="node" /> | ||
*/ | ||
export interface IXyoSigner { | ||
export interface IXyoSigner extends IXyoSerializableObject { | ||
/** | ||
@@ -32,0 +32,0 @@ * Subclasses will return the publicKey of the crypto key pair |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Tuesday, 11th December 2018 9:26:22 am | ||
* @Last modified time: Thursday, 13th December 2018 10:07:02 am | ||
* @License: All Rights Reserved | ||
@@ -11,0 +11,0 @@ * @Copyright: Copyright XY | The Findables Company |
/// <reference types="node" /> | ||
import { IXyoSigner, IXyoPublicKey, IXyoSignature } from "./@types"; | ||
export declare class XyoStubSigner implements IXyoSigner { | ||
import { XyoBaseSerializable, IXyoDeserializer } from "@xyo-network/serialization"; | ||
export declare class XyoStubSigner extends XyoBaseSerializable implements IXyoSigner { | ||
readonly publicKey: IXyoPublicKey; | ||
readonly signature: IXyoSignature; | ||
static deserializer: IXyoDeserializer<XyoStubSigner>; | ||
readonly schemaObjectId: number; | ||
constructor(publicKey: IXyoPublicKey, signature: IXyoSignature); | ||
readonly privateKey: string; | ||
getReadableValue(): string; | ||
getData(): (IXyoPublicKey | IXyoSignature)[]; | ||
signData(data: Buffer): Promise<IXyoSignature>; | ||
} | ||
//# sourceMappingURL=xyo-stub-signer.d.ts.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Tuesday, 11th December 2018 9:29:32 am | ||
* @Last modified time: Thursday, 13th December 2018 10:18:13 am | ||
* @License: All Rights Reserved | ||
@@ -22,6 +22,10 @@ * @Copyright: Copyright XY | The Findables Company | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class XyoStubSigner { | ||
const serialization_1 = require("@xyo-network/serialization"); | ||
const serialization_schema_1 = require("@xyo-network/serialization-schema"); | ||
class XyoStubSigner extends serialization_1.XyoBaseSerializable { | ||
constructor(publicKey, signature) { | ||
super(serialization_schema_1.schema); | ||
this.publicKey = publicKey; | ||
this.signature = signature; | ||
this.schemaObjectId = serialization_schema_1.schema.stubSigner.id; | ||
} | ||
@@ -31,2 +35,11 @@ get privateKey() { | ||
} | ||
getReadableValue() { | ||
return this.privateKey; | ||
} | ||
getData() { | ||
return [ | ||
this.publicKey, | ||
this.signature | ||
]; | ||
} | ||
signData(data) { | ||
@@ -39,2 +52,14 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.XyoStubSigner = XyoStubSigner; | ||
// tslint:disable-next-line:max-classes-per-file | ||
class XyoStubSignerDeserializer { | ||
constructor() { | ||
this.schemaObjectId = serialization_schema_1.schema.stubSigner.id; | ||
} | ||
deserialize(data, serializationService) { | ||
const parseResult = serializationService.parse(data); | ||
const query = new serialization_1.ParseQuery(parseResult); | ||
return new XyoStubSigner(serializationService.deserialize(query.getChildAt(0).readData(true)).hydrate(), serializationService.deserialize(query.getChildAt(1).readData(true)).hydrate()); | ||
} | ||
} | ||
XyoStubSigner.deserializer = new XyoStubSignerDeserializer(); | ||
//# sourceMappingURL=xyo-stub-signer.js.map |
{ | ||
"name": "@xyo-network/signing", | ||
"version": "0.8.3", | ||
"version": "0.9.0", | ||
"description": "Signing Types and Services for the XYO Network", | ||
@@ -10,4 +10,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@xyo-network/serialization": "^0.8.3", | ||
"@xyo-network/serialization-schema": "^0.8.3" | ||
"@xyo-network/serialization": "^0.9.0", | ||
"@xyo-network/serialization-schema": "^0.9.0" | ||
}, | ||
@@ -23,3 +23,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "31a78a32582abf7e084767fdba166cc19be23430" | ||
"gitHead": "130fae720a41b2fac61833a689a12bf7031a60bd" | ||
} |
@@ -7,3 +7,3 @@ /* | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Tuesday, 11th December 2018 9:26:22 am | ||
* @Last modified time: Thursday, 13th December 2018 10:07:02 am | ||
* @License: All Rights Reserved | ||
@@ -46,3 +46,3 @@ * @Copyright: Copyright XY | The Findables Company | ||
*/ | ||
export interface IXyoSigner { | ||
export interface IXyoSigner extends IXyoSerializableObject { | ||
@@ -49,0 +49,0 @@ /** |
@@ -7,3 +7,3 @@ /* | ||
* @Last modified by: ryanxyo | ||
* @Last modified time: Tuesday, 11th December 2018 9:29:32 am | ||
* @Last modified time: Thursday, 13th December 2018 10:18:13 am | ||
* @License: All Rights Reserved | ||
@@ -14,4 +14,8 @@ * @Copyright: Copyright XY | The Findables Company | ||
import { IXyoSigner, IXyoPublicKey, IXyoSignature } from "./@types" | ||
import { XyoBaseSerializable, IXyoDeserializer, IXyoSerializationService, ParseQuery } from "@xyo-network/serialization" | ||
import { schema } from '@xyo-network/serialization-schema' | ||
export class XyoStubSigner extends XyoBaseSerializable implements IXyoSigner { | ||
export class XyoStubSigner implements IXyoSigner { | ||
public static deserializer: IXyoDeserializer<XyoStubSigner> | ||
public readonly schemaObjectId = schema.stubSigner.id | ||
@@ -21,3 +25,5 @@ constructor ( | ||
public readonly signature: IXyoSignature | ||
) {} | ||
) { | ||
super(schema) | ||
} | ||
@@ -28,2 +34,13 @@ get privateKey () { | ||
public getReadableValue() { | ||
return this.privateKey | ||
} | ||
public getData() { | ||
return [ | ||
this.publicKey, | ||
this.signature | ||
] | ||
} | ||
public async signData(data: Buffer): Promise<IXyoSignature> { | ||
@@ -33,1 +50,17 @@ return this.signature | ||
} | ||
// tslint:disable-next-line:max-classes-per-file | ||
class XyoStubSignerDeserializer implements IXyoDeserializer<XyoStubSigner> { | ||
public readonly schemaObjectId = schema.stubSigner.id | ||
public deserialize(data: Buffer, serializationService: IXyoSerializationService): XyoStubSigner { | ||
const parseResult = serializationService.parse(data) | ||
const query = new ParseQuery(parseResult) | ||
return new XyoStubSigner( | ||
serializationService.deserialize(query.getChildAt(0).readData(true)).hydrate<IXyoPublicKey>(), | ||
serializationService.deserialize(query.getChildAt(1).readData(true)).hydrate<IXyoSignature>() | ||
) | ||
} | ||
} | ||
XyoStubSigner.deserializer = new XyoStubSignerDeserializer() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26974
516
4
+ Added@xyo-network/base@0.9.0(transitive)
+ Added@xyo-network/errors@0.9.0(transitive)
+ Added@xyo-network/serialization@0.9.0(transitive)
+ Added@xyo-network/serialization-schema@0.9.1(transitive)
- Removed@xyo-network/base@0.8.0(transitive)
- Removed@xyo-network/errors@0.8.0(transitive)
- Removed@xyo-network/serialization@0.8.3(transitive)
- Removed@xyo-network/serialization-schema@0.8.3(transitive)