UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

34 lines (33 loc) 1.52 kB
import { Observable } from 'rxjs'; import { PowerShellSession } from './powershell'; import { PowerShellConnection } from './powershell-connection'; /** * powerShellCrypto Crypto interface class. * @dynamic */ export declare class PowerShellCrypto { /** * encrypt with RSA/SHA-1 * * @param jwk the JSON Web Key. Single string with JSON.stringify format. * @param data the original data to hash. * @return Observable<string> the hash generated. */ /** * Creates an RSAProvider or reuses a cached one on a node and returns its JSON Web Key string * * @param powerShellConnection the established powerShell connection to the node * @param powerShellSession the established powerShell session with the node * @return Observable<string> the jwk string. */ static getEncryptionJWKFromNode(powerShellConnection: PowerShellConnection, powerShellSession: PowerShellSession): Observable<string>; /** * Creates an RSAProvider or reuses a cached one on a node and uses its jwk to encrypt data * * @param powerShellConnection the established powerShell connection to the node * @param powerShellSession the established powerShell session with the node * @param data string data to be encrypted * @return Observable<string> the encrypted data or null if data is null. */ static encryptDataUsingNodeJWK(powerShellConnection: PowerShellConnection, powerShellSession: PowerShellSession, data: string): Observable<string>; }