@casual-simulation/crypto
Advanced tools
Comparing version 3.1.27-alpha.4430491303 to 3.2.0
@@ -90,3 +90,3 @@ /** | ||
*/ | ||
export declare type SigningCryptoKey = PrivateCryptoKey | PublicCryptoKey; | ||
export type SigningCryptoKey = PrivateCryptoKey | PublicCryptoKey; | ||
//# sourceMappingURL=CryptoImpl.d.ts.map |
@@ -62,6 +62,13 @@ interface DerivedKey { | ||
/** | ||
* Determines whether the given keypair is a valid asymmetric keypair. | ||
* Note that this function only determines if the keypair could have been generated by asymmetricKeypair(), | ||
* not that it was or that it can be used to decrypt something. | ||
* @param keypair The keypair to test. | ||
* Determines if the given value is a keypair generated using {@link crypto.asymmetric.keypair}. | ||
* Returns true if the data is a keypair and false otherwise. | ||
* | ||
* @param keypair the value that should be tested to see if it is a keypair. | ||
* | ||
* @example Determine if a value is a keypair. | ||
* const encrypted = crypto.asymmetric.isKeypair("hello, world"); | ||
* os.toast('Is it a keypair? ' + encrypted); | ||
* | ||
* @dochash actions/crypto | ||
* @docname crypto.asymmetric.isKeypair | ||
*/ | ||
@@ -164,9 +171,27 @@ export declare function isAsymmetricKeypair(keypair: string): boolean; | ||
/** | ||
* Determines whether the given data appears to be encrypted using asymmetric encryption. | ||
* @param cyphertext The cyphertext to test. | ||
* Determines if the given value was encrypted using {@link crypto.asymmetric.encrypt}. | ||
* Returns `true` if the data is a keypair and `false` otherwise. | ||
* | ||
* @param cyphertext the value that should be tested to see if it is encrypted. | ||
* | ||
* @example Determine if a value is encrypted with asymmetric encryption. | ||
* const encrypted = crypto.asymmetric.isEncrypted("hello, world"); | ||
* os.toast('Is it encrypted? ' + encrypted); | ||
* | ||
* @dochash actions/crypto | ||
* @docname crypto.asymmetric.isEncrypted | ||
*/ | ||
export declare function isAsymmetricEncrypted(cyphertext: string): boolean; | ||
/** | ||
* Determines whether the given data appears to be encrypted using symmetric encryption. | ||
* @param cyphertext The cyphertext to test. | ||
* Determines if the given value has been encrypted using {@link crypto.encrypt}. | ||
* Returns true if the data is encrypted and false otherwise. | ||
* | ||
* @param cyphertext the value that should be tested to see if it has been encrypted. | ||
* | ||
* @example Determine if a value is encrypted. | ||
* const encrypted = crypto.isEncrypted("hello, world"); | ||
* os.toast('Is it encrypted? ' + encrypted); | ||
* | ||
* @dochash actions/crypto | ||
* @docname crypto.isEncrypted | ||
*/ | ||
@@ -173,0 +198,0 @@ export declare function isEncrypted(cyphertext: string): boolean; |
@@ -131,6 +131,13 @@ import { randomBytes, secretbox, box } from 'tweetnacl'; | ||
/** | ||
* Determines whether the given keypair is a valid asymmetric keypair. | ||
* Note that this function only determines if the keypair could have been generated by asymmetricKeypair(), | ||
* not that it was or that it can be used to decrypt something. | ||
* @param keypair The keypair to test. | ||
* Determines if the given value is a keypair generated using {@link crypto.asymmetric.keypair}. | ||
* Returns true if the data is a keypair and false otherwise. | ||
* | ||
* @param keypair the value that should be tested to see if it is a keypair. | ||
* | ||
* @example Determine if a value is a keypair. | ||
* const encrypted = crypto.asymmetric.isKeypair("hello, world"); | ||
* os.toast('Is it a keypair? ' + encrypted); | ||
* | ||
* @dochash actions/crypto | ||
* @docname crypto.asymmetric.isKeypair | ||
*/ | ||
@@ -339,4 +346,13 @@ export function isAsymmetricKeypair(keypair) { | ||
/** | ||
* Determines whether the given data appears to be encrypted using asymmetric encryption. | ||
* @param cyphertext The cyphertext to test. | ||
* Determines if the given value was encrypted using {@link crypto.asymmetric.encrypt}. | ||
* Returns `true` if the data is a keypair and `false` otherwise. | ||
* | ||
* @param cyphertext the value that should be tested to see if it is encrypted. | ||
* | ||
* @example Determine if a value is encrypted with asymmetric encryption. | ||
* const encrypted = crypto.asymmetric.isEncrypted("hello, world"); | ||
* os.toast('Is it encrypted? ' + encrypted); | ||
* | ||
* @dochash actions/crypto | ||
* @docname crypto.asymmetric.isEncrypted | ||
*/ | ||
@@ -352,4 +368,13 @@ export function isAsymmetricEncrypted(cyphertext) { | ||
/** | ||
* Determines whether the given data appears to be encrypted using symmetric encryption. | ||
* @param cyphertext The cyphertext to test. | ||
* Determines if the given value has been encrypted using {@link crypto.encrypt}. | ||
* Returns true if the data is encrypted and false otherwise. | ||
* | ||
* @param cyphertext the value that should be tested to see if it has been encrypted. | ||
* | ||
* @example Determine if a value is encrypted. | ||
* const encrypted = crypto.isEncrypted("hello, world"); | ||
* os.toast('Is it encrypted? ' + encrypted); | ||
* | ||
* @dochash actions/crypto | ||
* @docname crypto.isEncrypted | ||
*/ | ||
@@ -356,0 +381,0 @@ export function isEncrypted(cyphertext) { |
{ | ||
"name": "@casual-simulation/crypto", | ||
"version": "3.1.27-alpha.4430491303", | ||
"version": "3.2.0", | ||
"description": "Crypto helpers used by AUX", | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "3bec2d38f5f1d75f0e854de0535da89cbb85cd81" | ||
"gitHead": "84345e82879f64da9701f6030f355eb0d47c69eb" | ||
} |
/** | ||
* The possible signature algorithm types. | ||
*/ | ||
export declare type SignatureAlgorithmType = ECDSA_SHA256_NISTP256; | ||
export type SignatureAlgorithmType = ECDSA_SHA256_NISTP256; | ||
/** | ||
@@ -14,3 +14,3 @@ * Defines a signature algorithm that uses ECDSA Curve P-256 for signing and verification | ||
*/ | ||
export declare type ECDSA_SHA256_NISTP256 = 'ECDSA-SHA256-NISTP256'; | ||
export type ECDSA_SHA256_NISTP256 = 'ECDSA-SHA256-NISTP256'; | ||
//# sourceMappingURL=SignatureAlgorithm.d.ts.map |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
81378
1380
0