Skip to content

Commit aa22da1

Browse files
Added cssm_data
1 parent f60b0ff commit aa22da1

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

Security/SecAsn1Types.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { assertEquals } from '@std/assert';
2+
import { cssm_data } from './SecAsn1Types.ts';
3+
4+
Deno.test('cssm_data', () => {
5+
const cd = new cssm_data();
6+
assertEquals(cd.Length, 0);
7+
assertEquals(cd.Data, null);
8+
});

Security/SecAsn1Types.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { toStringTag } from '@hqtsm/class';
2+
import type { Ptr } from '@hqtsm/struct';
3+
import type { size_t } from '../libc/stddef.ts';
4+
import type { uint8_t } from '../libc/stdint.ts';
5+
6+
/**
7+
* CSSM data.
8+
*/
9+
export class cssm_data {
10+
/**
11+
* Data length.
12+
*/
13+
public Length: size_t = 0;
14+
15+
/**
16+
* Data pointer.
17+
*/
18+
public Data: Ptr<uint8_t> | null = null;
19+
20+
static {
21+
toStringTag(this, 'cssm_data');
22+
}
23+
}
24+
25+
/**
26+
* ASN.1 item.
27+
*/
28+
export type SecAsn1Item = cssm_data;
29+
30+
/**
31+
* ASN.1 OID.
32+
*/
33+
export type SecAsn1Oid = cssm_data;

Security/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export * from './errors.ts';
77
export * from './hashing.ts';
88
export * from './macho.ts';
99
export * from './SecBase.ts';
10+
export * from './SecAsn1Types.ts';
1011
export * from './superblob.ts';

0 commit comments

Comments
 (0)