EnvelopedData
Class from RFC5652
Static Method Summary
Static Public Methods | ||
public static |
compareWithDefault(memberName: string, memberValue: *): * Compare values with default values for all class members |
|
public static |
defaultValues(memberName: string): *[] Return default values for all class members |
|
public static |
Return value of asn1js schema for current class |
Constructor Summary
Public Constructor | ||
public |
constructor(parameters: Object) Constructor for EnvelopedData class |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
addRecipientByCertificate(certificate: Certificate, parameters: Object, variant: number): boolean Helpers function for filling "RecipientInfo" based on recipient's certificate. Problem with WebCrypto is that for RSA certificates we have only one option - "key transport" and for ECC certificates we also have one option - "key agreement". As soon as Google will implement DH algorithm it would be possible to use "key agreement" also for RSA certificates. |
|
public |
addRecipientByPreDefinedData(preDefinedData: ArrayBuffer, parameters: Object, variant: number) Add recipient based on pre-defined data like password or KEK |
|
public |
Decrypt existing CMS Enveloped Data content |
|
public |
encrypt(contentEncryptionAlgorithm: Object, contentToEncrypt: ArrayBuffer): Promise Create a new CMS Enveloped Data content with encrypted data |
|
public |
fromSchema(schema: Object) Convert parsed asn1js object into current class |
|
public |
Convertion for the class to JSON object |
|
public |
Convert current object to asn1js object and set correct values |
Static Public Methods
public static compareWithDefault(memberName: string, memberValue: *): * source
Compare values with default values for all class members
Params:
Name | Type | Attribute | Description |
memberName | string | String name for a class member |
|
memberValue | * | Value to compare with default value |
Return:
* |
Public Constructors
Public Members
public encryptedContentInfo: EncryptedContentInfo source
public originatorInfo: OriginatorInfo source
public recipientInfos: Array<RecipientInfo> source
Public Methods
public addRecipientByCertificate(certificate: Certificate, parameters: Object, variant: number): boolean source
Helpers function for filling "RecipientInfo" based on recipient's certificate. Problem with WebCrypto is that for RSA certificates we have only one option - "key transport" and for ECC certificates we also have one option - "key agreement". As soon as Google will implement DH algorithm it would be possible to use "key agreement" also for RSA certificates.
Params:
Name | Type | Attribute | Description |
certificate | Certificate |
|
Recipient's certificate |
parameters | Object |
|
Additional parameters neccessary for "fine tunning" of encryption process |
variant | number |
|
Variant = 1 is for "key transport", variant = 2 is for "key agreement". In fact the "variant" is unneccessary now because Google has no DH algorithm implementation. Thus key encryption scheme would be choosen by certificate type only: "key transport" for RSA and "key agreement" for ECC certificates. |
public addRecipientByPreDefinedData(preDefinedData: ArrayBuffer, parameters: Object, variant: number) source
Add recipient based on pre-defined data like password or KEK
Params:
Name | Type | Attribute | Description |
preDefinedData | ArrayBuffer | ArrayBuffer with pre-defined data |
|
parameters | Object | Additional parameters neccessary for "fine tunning" of encryption process |
|
variant | number | Variant = 1 for pre-defined "key encryption key" (KEK). Variant = 2 for password-based encryption. |
public decrypt(recipientIndex: number, parameters: Object): Promise source
Decrypt existing CMS Enveloped Data content
public encrypt(contentEncryptionAlgorithm: Object, contentToEncrypt: ArrayBuffer): Promise source
Create a new CMS Enveloped Data content with encrypted data
Params:
Name | Type | Attribute | Description |
contentEncryptionAlgorithm | Object | WebCrypto algorithm. For the moment here could be only "AES-CBC" or "AES-GCM" algorithms. |
|
contentToEncrypt | ArrayBuffer | Content to encrypt |