Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xyo-network/signing

Package Overview
Dependencies
Maintainers
4
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xyo-network/signing - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

dist/@types/index.d.ts

67

dist/index.d.ts

@@ -1,64 +0,5 @@

/// <reference types="node" />
import { IXyoSerializableObject } from '@xyo-network/serialization';
/**
* Xyo Public key wrapper
*/
export interface IXyoPublicKey extends IXyoSerializableObject {
/** Returns the raw bytes of the public-key */
getRawPublicKey(): Buffer;
}
/**
* Xyo Signature Wrapper
*/
export interface IXyoSignature extends IXyoSerializableObject {
/**
* Subclasses will return a binary-representation of the signature
*/
encodedSignature: Buffer;
/**
* Verifies that this signature is valid
*
* @param data The data that was signed
* @param publicKey The public key associated with the crypto key-pair
*/
verify(data: Buffer, publicKey: IXyoPublicKey): Promise<boolean>;
}
/**
* Abstraction for an instance of an object that providers signing services
*/
export interface IXyoSigner {
/**
* Subclasses will return the publicKey of the crypto key pair
*/
publicKey: IXyoPublicKey;
/**
* This should return the private key
*/
privateKey: any;
/**
* Signs an arbitrary data blob
*
* @param data An arbitrary data blob to sign
* @returns An xyo signature
*/
signData(data: Buffer): Promise<IXyoSignature>;
}
/**
* Provides new instances of xyo-signers
*/
export interface IXyoSignerProvider {
/**
* Returns a new instance of a signer
*/
newInstance(fromPrivateKey?: any): IXyoSigner;
/**
* Verifies a a signature given the data that was signed, and a public key
*
* @param signature The signature to verify
* @param data The data that was signed
* @param publicKey The corresponding publicKey of public cryptography key-pair
* @returns Will return true if the signature/public-key matches that data passed in
*/
verifySign(signature: IXyoSignature, data: Buffer, publicKey: IXyoPublicKey): Promise<boolean>;
}
export { IXyoPublicKey, IXyoSignature, IXyoSigner, IXyoSignerProvider } from './@types';
export { XyoStubPublicKey } from './xyo-stub-public-key';
export { XyoStubSignature } from './xyo-stub-signature';
export { XyoStubSigner } from './xyo-stub-signer';
//# sourceMappingURL=index.d.ts.map

@@ -8,3 +8,3 @@ "use strict";

* @Last modified by: ryanxyo
* @Last modified time: Monday, 26th November 2018 3:09:03 pm
* @Last modified time: Tuesday, 11th December 2018 9:30:23 am
* @License: All Rights Reserved

@@ -14,2 +14,8 @@ * @Copyright: Copyright XY | The Findables Company

Object.defineProperty(exports, "__esModule", { value: true });
var xyo_stub_public_key_1 = require("./xyo-stub-public-key");
exports.XyoStubPublicKey = xyo_stub_public_key_1.XyoStubPublicKey;
var xyo_stub_signature_1 = require("./xyo-stub-signature");
exports.XyoStubSignature = xyo_stub_signature_1.XyoStubSignature;
var xyo_stub_signer_1 = require("./xyo-stub-signer");
exports.XyoStubSigner = xyo_stub_signer_1.XyoStubSigner;
//# sourceMappingURL=index.js.map
{
"name": "@xyo-network/signing",
"version": "0.2.1",
"version": "0.3.0",
"description": "Signing Types and Services for the Xyo Network",

@@ -10,3 +10,4 @@ "main": "dist/index.js",

"dependencies": {
"@xyo-network/serialization": "^0.2.1"
"@xyo-network/serialization": "^0.3.0",
"@xyo-network/serialization-schema": "^0.3.0"
},

@@ -22,3 +23,3 @@ "devDependencies": {

},
"gitHead": "0635d162b742fbb5ee4f09d4e3faf5149b43eaf0"
"gitHead": "55319bda08512a2701fb6494ad2e2526791e6bb7"
}

@@ -7,3 +7,3 @@ /*

* @Last modified by: ryanxyo
* @Last modified time: Monday, 26th November 2018 3:09:03 pm
* @Last modified time: Tuesday, 11th December 2018 9:30:23 am
* @License: All Rights Reserved

@@ -13,74 +13,5 @@ * @Copyright: Copyright XY | The Findables Company

import { IXyoSerializableObject } from '@xyo-network/serialization'
/**
* Xyo Public key wrapper
*/
export interface IXyoPublicKey extends IXyoSerializableObject {
/** Returns the raw bytes of the public-key */
getRawPublicKey(): Buffer
}
/**
* Xyo Signature Wrapper
*/
export interface IXyoSignature extends IXyoSerializableObject {
/**
* Subclasses will return a binary-representation of the signature
*/
encodedSignature: Buffer
/**
* Verifies that this signature is valid
*
* @param data The data that was signed
* @param publicKey The public key associated with the crypto key-pair
*/
verify (data: Buffer, publicKey: IXyoPublicKey): Promise<boolean>
}
/**
* Abstraction for an instance of an object that providers signing services
*/
export interface IXyoSigner {
/**
* Subclasses will return the publicKey of the crypto key pair
*/
publicKey: IXyoPublicKey
/**
* This should return the private key
*/
privateKey: any
/**
* Signs an arbitrary data blob
*
* @param data An arbitrary data blob to sign
* @returns An xyo signature
*/
signData(data: Buffer): Promise<IXyoSignature>
}
/**
* Provides new instances of xyo-signers
*/
export interface IXyoSignerProvider {
/**
* Returns a new instance of a signer
*/
newInstance(fromPrivateKey?: any): IXyoSigner
/**
* Verifies a a signature given the data that was signed, and a public key
*
* @param signature The signature to verify
* @param data The data that was signed
* @param publicKey The corresponding publicKey of public cryptography key-pair
* @returns Will return true if the signature/public-key matches that data passed in
*/
verifySign(signature: IXyoSignature, data: Buffer, publicKey: IXyoPublicKey): Promise<boolean>
}
export { IXyoPublicKey, IXyoSignature, IXyoSigner, IXyoSignerProvider } from './@types'
export { XyoStubPublicKey } from './xyo-stub-public-key'
export { XyoStubSignature } from './xyo-stub-signature'
export { XyoStubSigner } from './xyo-stub-signer'

@@ -25,4 +25,5 @@ {

"references": [
{"path": "../serialization-schema"},
{"path": "../serialization"}
]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc