@c8y/client
Version:
Client application programming interface to access the Cumulocity IoT-Platform REST services.
69 lines • 2.35 kB
TypeScript
import { IFetchOptions, IFetchResponse, IResult, Service } from '../core/index.js';
import { ICertificateRevocation } from './ICertificateRevocation.js';
import { Stream } from 'stream';
/**
* This class allows for managing a list of certificate revocations.
*/
export declare class CrlService extends Service<ICertificateRevocation> {
protected get baseUrl(): string;
protected readonly listUrl: string;
/**
* Uploads a list of certificate revocations.
* Adds new entries to the certificate revocation list,
* the ones that already exist are updated.
* No entries are removed from the certificate revocation list.
*
* @returns Returns a status object.
*
* **Example**
* ```typescript
*
* const crls: ICertificateRevocation[] = [
* { serialNumberInHex: '24234', revocationDate: '2023-01-13T23:00:00.000Z' }
* ];
*
* (async () => {
* const { res } = await crlService.uploadCrls(crls);
* })();
* ```
*/
uploadCrls(crls: ICertificateRevocation[]): Promise<IResult<null>>;
/**
* Uploads a csv file containing a list of certificate revocations.
* Adds new entries to the certificate revocation list,
* the ones that already exist are updated.
* No entries are removed from the certificate revocation list.
*
* File format:
* SERIALNO,DATE
* 1234567890abcdef,2023-01-01T00:00:00.000Z
*
* @returns Returns a status object.
*
* **Example**
* ```typescript
*
* (async () => {
* const { res } = await crlService.uploadCrlFile( file );
* })();
* ```
*/
uploadCrlFile(file: Stream | Buffer | File | Blob): Promise<IResult<null>>;
/**
* Downloads a certificate revocation list file.
* To open the downloaded file please use command: openssl crl -inform DER -text -noout -in fileName.crl
*
* @returns Returns a arrayBuffer wrapped in [[IFetchResponse]].
*
* **Example**
* ```typescript
*
* (async () => {
* const res = await this.crlService.downloadCrlFile();
* const arrayBuffer = await res.arrayBuffer();
* })();
* ```
*/
downloadCrlFile(init?: IFetchOptions): Promise<IFetchResponse>;
}
//# sourceMappingURL=CrlService.d.ts.map