@nictool/dns-resource-record 1.1.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc.yml +3 -0
- package/CHANGELOG.md +17 -43
- package/README.md +56 -62
- package/index.js +77 -29
- package/lib/tinydns.js +68 -61
- package/package.json +10 -6
- package/rr/a.js +19 -20
- package/rr/aaaa.js +35 -31
- package/rr/caa.js +41 -39
- package/rr/cert.js +21 -19
- package/rr/cname.js +19 -20
- package/rr/dname.js +19 -19
- package/rr/dnskey.js +48 -41
- package/rr/ds.js +38 -36
- package/rr/hinfo.js +26 -25
- package/rr/ipseckey.js +53 -45
- package/rr/key.js +21 -21
- package/rr/loc.js +67 -54
- package/rr/mx.js +26 -24
- package/rr/naptr.js +51 -52
- package/rr/ns.js +25 -22
- package/rr/nsec.js +26 -20
- package/rr/nsec3.js +90 -30
- package/rr/nsec3param.js +29 -26
- package/rr/nxt.js +67 -0
- package/rr/openpgpkey.js +13 -14
- package/rr/ptr.js +20 -21
- package/rr/rrsig.js +27 -21
- package/rr/sig.js +24 -19
- package/rr/smimea.js +35 -28
- package/rr/soa.js +57 -42
- package/rr/spf.js +20 -17
- package/rr/srv.js +41 -41
- package/rr/sshfp.js +29 -30
- package/rr/tlsa.js +47 -40
- package/rr/tsig.js +48 -0
- package/rr/txt.js +40 -33
- package/rr/uri.js +31 -31
- package/rr/wks.js +44 -0
- package/rr.js +116 -79
- package/.codeclimate.yml +0 -25
- package/DEVELOP.md +0 -23
- package/test/a.js +0 -76
- package/test/aaaa.js +0 -79
- package/test/base.js +0 -138
- package/test/caa.js +0 -104
- package/test/cert.js +0 -48
- package/test/cname.js +0 -41
- package/test/dname.js +0 -53
- package/test/dnskey.js +0 -44
- package/test/ds.js +0 -44
- package/test/fake.js +0 -26
- package/test/hinfo.js +0 -75
- package/test/ipseckey.js +0 -115
- package/test/key.js +0 -37
- package/test/loc.js +0 -71
- package/test/mx.js +0 -75
- package/test/naptr.js +0 -40
- package/test/ns.js +0 -53
- package/test/nsec.js +0 -38
- package/test/nsec3.js +0 -26
- package/test/nsec3param.js +0 -26
- package/test/openpgpkey.js +0 -35
- package/test/ptr.js +0 -54
- package/test/rr.js +0 -196
- package/test/smimea.js +0 -45
- package/test/soa.js +0 -77
- package/test/spf.js +0 -48
- package/test/srv.js +0 -81
- package/test/sshfp.js +0 -62
- package/test/tinydns.js +0 -140
- package/test/tlsa.js +0 -54
- package/test/txt.js +0 -70
- package/test/uri.js +0 -61
package/rr/nxt.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import RR from '../rr.js'
|
|
2
|
+
|
|
3
|
+
export default class NXT extends RR {
|
|
4
|
+
constructor(opts) {
|
|
5
|
+
super(opts)
|
|
6
|
+
if (opts === null) return
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/****** Resource record specific setters *******/
|
|
10
|
+
setNextDomain(val) {
|
|
11
|
+
if (!val)
|
|
12
|
+
throw new Error(`NXT: 'next domain' is required:, ${this.citeRFC()}`)
|
|
13
|
+
|
|
14
|
+
this.isFullyQualified('NXT', 'next domain', val)
|
|
15
|
+
this.isValidHostname('NXT', 'next domain', val)
|
|
16
|
+
|
|
17
|
+
// RFC 4034: letters in the DNS names are lower cased
|
|
18
|
+
this.set('next domain', val.toLowerCase())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
setTypeBitMap(val) {
|
|
22
|
+
if (!val)
|
|
23
|
+
throw new Error(`NXT: 'type bit map' is required, ${this.citeRFC()}`)
|
|
24
|
+
|
|
25
|
+
this.set('type bit map', val)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getDescription() {
|
|
29
|
+
return 'Next Secure'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getRdataFields(arg) {
|
|
33
|
+
return ['next domain', 'type bit map']
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getRFCs() {
|
|
37
|
+
return [2065]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
getTypeId() {
|
|
41
|
+
return 30
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/****** IMPORTERS *******/
|
|
45
|
+
|
|
46
|
+
fromBind(opts) {
|
|
47
|
+
// test.example.com 3600 IN NXT NextDomain TypeBitMap
|
|
48
|
+
const [owner, ttl, c, type, next] = opts.bindline.split(/\s+/)
|
|
49
|
+
return new NXT({
|
|
50
|
+
owner,
|
|
51
|
+
ttl: parseInt(ttl, 10),
|
|
52
|
+
class: c,
|
|
53
|
+
type: type,
|
|
54
|
+
'next domain': next,
|
|
55
|
+
'type bit map': opts.bindline
|
|
56
|
+
.split(/\s+/)
|
|
57
|
+
.slice(5)
|
|
58
|
+
.filter(removeParens)
|
|
59
|
+
.join(' ')
|
|
60
|
+
.trim(),
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/****** EXPORTERS *******/
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const removeParens = (a) => !['(', ')'].includes(a)
|
package/rr/openpgpkey.js
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
|
|
2
1
|
import RR from '../rr.js'
|
|
3
2
|
|
|
4
3
|
export default class OPENPGPKEY extends RR {
|
|
5
|
-
constructor
|
|
4
|
+
constructor(opts) {
|
|
6
5
|
super(opts)
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
/****** Resource record specific setters *******/
|
|
10
|
-
setPublicKey
|
|
9
|
+
setPublicKey(val) {
|
|
11
10
|
this.set('public key', val)
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
getDescription
|
|
13
|
+
getDescription() {
|
|
15
14
|
return 'OpenPGP Public Key'
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
getRdataFields
|
|
19
|
-
return [
|
|
17
|
+
getRdataFields() {
|
|
18
|
+
return ['public key']
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
getRFCs
|
|
23
|
-
return [
|
|
21
|
+
getRFCs() {
|
|
22
|
+
return [4880, 7929]
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
getTypeId
|
|
25
|
+
getTypeId() {
|
|
27
26
|
return 61
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/****** IMPORTERS *******/
|
|
31
|
-
fromBind
|
|
30
|
+
fromBind(str) {
|
|
32
31
|
// test.example.com 3600 IN OPENPGPKEY <base64 public key>
|
|
33
|
-
const [
|
|
32
|
+
const [owner, ttl, c, type, privatekey] = str.split(/\s+/)
|
|
34
33
|
return new OPENPGPKEY({
|
|
35
34
|
owner,
|
|
36
|
-
ttl
|
|
37
|
-
class
|
|
38
|
-
type
|
|
35
|
+
ttl: parseInt(ttl, 10),
|
|
36
|
+
class: c,
|
|
37
|
+
type: type,
|
|
39
38
|
'private key': privatekey,
|
|
40
39
|
})
|
|
41
40
|
}
|
package/rr/ptr.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
1
|
import RR from '../rr.js'
|
|
3
2
|
|
|
4
3
|
export default class PTR extends RR {
|
|
5
|
-
constructor
|
|
4
|
+
constructor(opts) {
|
|
6
5
|
super(opts)
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
/****** Resource record specific setters *******/
|
|
10
|
-
setDname
|
|
9
|
+
setDname(val) {
|
|
11
10
|
this.isFullyQualified('PTR', 'dname', val)
|
|
12
11
|
this.isValidHostname('PTR', 'dname', val)
|
|
13
12
|
|
|
@@ -15,51 +14,51 @@ export default class PTR extends RR {
|
|
|
15
14
|
this.set('dname', val.toLowerCase())
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
getDescription
|
|
17
|
+
getDescription() {
|
|
19
18
|
return 'Pointer'
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
getRdataFields
|
|
23
|
-
return [
|
|
21
|
+
getRdataFields(arg) {
|
|
22
|
+
return ['dname']
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
getRFCs
|
|
27
|
-
return [
|
|
25
|
+
getRFCs() {
|
|
26
|
+
return [1035]
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
getTypeId
|
|
29
|
+
getTypeId() {
|
|
31
30
|
return 12
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
/****** IMPORTERS *******/
|
|
35
|
-
fromTinydns
|
|
34
|
+
fromTinydns(opts) {
|
|
36
35
|
// ^fqdn:p:ttl:timestamp:lo
|
|
37
|
-
const [
|
|
36
|
+
const [fqdn, p, ttl, ts, loc] = opts.tinyline.substring(1).split(':')
|
|
38
37
|
|
|
39
38
|
return new PTR({
|
|
40
|
-
owner
|
|
41
|
-
ttl
|
|
42
|
-
type
|
|
43
|
-
dname
|
|
39
|
+
owner: this.fullyQualify(fqdn),
|
|
40
|
+
ttl: parseInt(ttl, 10),
|
|
41
|
+
type: 'PTR',
|
|
42
|
+
dname: this.fullyQualify(p),
|
|
44
43
|
timestamp: ts,
|
|
45
|
-
location
|
|
44
|
+
location: loc !== '' && loc !== '\n' ? loc : '',
|
|
46
45
|
})
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
fromBind
|
|
48
|
+
fromBind(opts) {
|
|
50
49
|
// test.example.com 3600 IN PTR dname
|
|
51
|
-
const [
|
|
50
|
+
const [owner, ttl, c, type, dname] = opts.bindline.split(/\s+/)
|
|
52
51
|
return new PTR({
|
|
53
52
|
owner,
|
|
54
|
-
ttl
|
|
53
|
+
ttl: parseInt(ttl, 10),
|
|
55
54
|
class: c,
|
|
56
|
-
type
|
|
55
|
+
type: type,
|
|
57
56
|
dname: dname,
|
|
58
57
|
})
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
/****** EXPORTERS *******/
|
|
62
|
-
toTinydns
|
|
61
|
+
toTinydns() {
|
|
63
62
|
return `^${this.getTinyFQDN('owner')}:${this.getTinyFQDN('dname')}:${this.getTinydnsPostamble()}\n`
|
|
64
63
|
}
|
|
65
64
|
}
|
package/rr/rrsig.js
CHANGED
|
@@ -1,85 +1,92 @@
|
|
|
1
|
-
|
|
2
1
|
import RR from '../rr.js'
|
|
3
2
|
|
|
4
3
|
export default class RRSIG extends RR {
|
|
5
|
-
constructor
|
|
4
|
+
constructor(opts) {
|
|
6
5
|
super(opts)
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
/****** Resource record specific setters *******/
|
|
10
|
-
setTypeCovered
|
|
9
|
+
setTypeCovered(val) {
|
|
11
10
|
// a 2 octet Type Covered field
|
|
12
11
|
if (!val) throw new Error(`RRSIG: 'type covered' is required`)
|
|
13
|
-
if (val.length > 2)
|
|
12
|
+
if (val.length > 2)
|
|
13
|
+
throw new Error(`RRSIG: 'type covered' is too long, ${this.citeRFC()}`)
|
|
14
14
|
|
|
15
15
|
this.set('type covered', val)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
setAlgorithm
|
|
18
|
+
setAlgorithm(val) {
|
|
19
19
|
// a 1 octet Algorithm field
|
|
20
20
|
// 1=RSA/MD5, 2=DH, 3=RRSIGA/SHA-1, 4=EC, 5=RSA/SHA-1
|
|
21
|
-
if (![
|
|
21
|
+
if (![1, 2, 3, 4, 5, 253, 254].includes(val))
|
|
22
22
|
throw new Error(`RRSIG: algorithm invalid, ${this.citeRFC()}`)
|
|
23
23
|
|
|
24
24
|
this.set('algorithm', val)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
setLabels
|
|
27
|
+
setLabels(val) {
|
|
28
28
|
// a 1 octet Labels field
|
|
29
29
|
this.is8bitInt('RRSIG', 'labels', val)
|
|
30
30
|
|
|
31
31
|
this.set('labels', val)
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
setOriginalTtl
|
|
34
|
+
setOriginalTtl(val) {
|
|
35
35
|
// a 4 octet Original TTL field
|
|
36
36
|
this.is32bitInt('RRSIG', 'original ttl', val)
|
|
37
37
|
|
|
38
38
|
this.set('original ttl', val)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
setSignatureExpiration
|
|
41
|
+
setSignatureExpiration(val) {
|
|
42
42
|
// a 4 octet Signature Expiration field
|
|
43
43
|
this.set('signature expiration', val)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
setSignatureInception
|
|
46
|
+
setSignatureInception(val) {
|
|
47
47
|
// a 4 octet Signature Inception field
|
|
48
48
|
this.set('signature inception', val)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
setKeyTag
|
|
51
|
+
setKeyTag(val) {
|
|
52
52
|
// a 2 octet Key tag
|
|
53
53
|
this.set('key tag', val)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
setSignersName
|
|
56
|
+
setSignersName(val) {
|
|
57
57
|
// the Signer's Name field
|
|
58
58
|
this.set('signers name', val)
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
setSignature
|
|
61
|
+
setSignature(val) {
|
|
62
62
|
// the Signature field.
|
|
63
63
|
|
|
64
64
|
this.set('signature', val)
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
getDescription
|
|
67
|
+
getDescription() {
|
|
68
68
|
return 'Resource Record Signature'
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
getRdataFields
|
|
71
|
+
getRdataFields(arg) {
|
|
72
72
|
return [
|
|
73
|
-
'type covered',
|
|
74
|
-
'
|
|
73
|
+
'type covered',
|
|
74
|
+
'algorithm',
|
|
75
|
+
'labels',
|
|
76
|
+
'original ttl',
|
|
77
|
+
'signature expiration',
|
|
78
|
+
'signature inception',
|
|
79
|
+
'key tag',
|
|
80
|
+
'signers name',
|
|
81
|
+
'signature',
|
|
75
82
|
]
|
|
76
83
|
}
|
|
77
84
|
|
|
78
|
-
getRFCs
|
|
79
|
-
return [
|
|
85
|
+
getRFCs() {
|
|
86
|
+
return [4034]
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
getTypeId
|
|
89
|
+
getTypeId() {
|
|
83
90
|
return 46
|
|
84
91
|
}
|
|
85
92
|
|
|
@@ -97,5 +104,4 @@ export default class RRSIG extends RR {
|
|
|
97
104
|
// }
|
|
98
105
|
|
|
99
106
|
/****** EXPORTERS *******/
|
|
100
|
-
|
|
101
107
|
}
|
package/rr/sig.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
1
|
import RR from '../rr.js'
|
|
3
2
|
|
|
4
3
|
export default class SIG extends RR {
|
|
5
|
-
constructor
|
|
4
|
+
constructor(opts) {
|
|
6
5
|
super(opts)
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
/****** Resource record specific setters *******/
|
|
10
|
-
setTypeCovered
|
|
9
|
+
setTypeCovered(val) {
|
|
11
10
|
// a 2 octet Type Covered field
|
|
12
11
|
if (!val) throw new Error(`SIG: 'type covered' is required`)
|
|
13
12
|
|
|
14
13
|
this.set('type covered', val)
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
setAlgorithm
|
|
16
|
+
setAlgorithm(val) {
|
|
18
17
|
// a 1 octet Algorithm field
|
|
19
18
|
|
|
20
19
|
this.is8bitInt('SIG', 'labels', val)
|
|
@@ -22,64 +21,71 @@ export default class SIG extends RR {
|
|
|
22
21
|
this.set('algorithm', val)
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
setLabels
|
|
24
|
+
setLabels(val) {
|
|
26
25
|
// a 1 octet Labels field
|
|
27
26
|
this.is8bitInt('SIG', 'labels', val)
|
|
28
27
|
|
|
29
28
|
this.set('labels', val)
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
setOriginalTtl
|
|
31
|
+
setOriginalTtl(val) {
|
|
33
32
|
// a 4 octet Original TTL field
|
|
34
33
|
this.is32bitInt('SIG', 'original ttl', val)
|
|
35
34
|
|
|
36
35
|
this.set('original ttl', val)
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
setSignatureExpiration
|
|
38
|
+
setSignatureExpiration(val) {
|
|
40
39
|
// a 4 octet Signature Expiration field
|
|
41
40
|
this.set('signature expiration', val)
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
setSignatureInception
|
|
43
|
+
setSignatureInception(val) {
|
|
45
44
|
// a 4 octet Signature Inception field
|
|
46
45
|
this.set('signature inception', val)
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
setKeyTag
|
|
48
|
+
setKeyTag(val) {
|
|
50
49
|
// a 2 octet Key tag
|
|
51
50
|
this.set('key tag', val)
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
setSignersName
|
|
53
|
+
setSignersName(val) {
|
|
55
54
|
// the domain name of the signer generating the SIG RR
|
|
56
55
|
|
|
57
56
|
// RFC 4034: letters in the DNS names are lower cased
|
|
58
57
|
this.set('signers name', val.toLowerCase())
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
setSignature
|
|
60
|
+
setSignature(val) {
|
|
62
61
|
// the Signature field.
|
|
63
62
|
|
|
64
63
|
this.set('signature', val)
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
getDescription
|
|
66
|
+
getDescription() {
|
|
68
67
|
return 'Signature'
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
getRdataFields
|
|
70
|
+
getRdataFields(arg) {
|
|
72
71
|
return [
|
|
73
|
-
'type covered',
|
|
74
|
-
'
|
|
72
|
+
'type covered',
|
|
73
|
+
'algorithm',
|
|
74
|
+
'labels',
|
|
75
|
+
'original ttl',
|
|
76
|
+
'signature expiration',
|
|
77
|
+
'signature inception',
|
|
78
|
+
'key tag',
|
|
79
|
+
'signers name',
|
|
80
|
+
'signature',
|
|
75
81
|
]
|
|
76
82
|
}
|
|
77
83
|
|
|
78
|
-
getRFCs
|
|
79
|
-
return [
|
|
84
|
+
getRFCs() {
|
|
85
|
+
return [2535]
|
|
80
86
|
}
|
|
81
87
|
|
|
82
|
-
getTypeId
|
|
88
|
+
getTypeId() {
|
|
83
89
|
return 24
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -96,5 +102,4 @@ export default class SIG extends RR {
|
|
|
96
102
|
// }
|
|
97
103
|
|
|
98
104
|
/****** EXPORTERS *******/
|
|
99
|
-
|
|
100
105
|
}
|
package/rr/smimea.js
CHANGED
|
@@ -1,73 +1,80 @@
|
|
|
1
|
-
|
|
2
1
|
import RR from '../rr.js'
|
|
3
2
|
|
|
4
3
|
export default class SMIMEA extends RR {
|
|
5
|
-
constructor
|
|
4
|
+
constructor(opts) {
|
|
6
5
|
super(opts)
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
/****** Resource record specific setters *******/
|
|
10
|
-
setCertificateUsage
|
|
11
|
-
if (![
|
|
9
|
+
setCertificateUsage(val) {
|
|
10
|
+
if (![0, 1, 2, 3].includes(val))
|
|
12
11
|
throw new Error(`SMIMEA: certificate usage invalid, ${this.citeRFC()}`)
|
|
13
12
|
|
|
14
13
|
this.set('certificate usage', val)
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
setSelector
|
|
18
|
-
if (![
|
|
16
|
+
setSelector(val) {
|
|
17
|
+
if (![0, 1].includes(val))
|
|
19
18
|
throw new Error(`SMIMEA: selector invalid, ${this.citeRFC()}`)
|
|
20
19
|
|
|
21
20
|
this.set('selector', val)
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
setMatchingType
|
|
25
|
-
if (![
|
|
23
|
+
setMatchingType(val) {
|
|
24
|
+
if (![0, 1, 2].includes(val))
|
|
26
25
|
throw new Error(`SMIMEA: matching type, ${this.citeRFC()}`)
|
|
27
26
|
|
|
28
27
|
this.set('matching type', val)
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
setCertificateAssociationData
|
|
30
|
+
setCertificateAssociationData(val) {
|
|
32
31
|
this.set('certificate association data', val)
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
getDescription () {
|
|
34
|
+
getDescription() {
|
|
37
35
|
return 'S/MIME cert association'
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
getRdataFields
|
|
41
|
-
return [
|
|
38
|
+
getRdataFields(arg) {
|
|
39
|
+
return [
|
|
40
|
+
'certificate usage',
|
|
41
|
+
'selector',
|
|
42
|
+
'matching type',
|
|
43
|
+
'certificate association data',
|
|
44
|
+
]
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
getRFCs
|
|
45
|
-
return [
|
|
47
|
+
getRFCs() {
|
|
48
|
+
return [8162]
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
getTypeId
|
|
51
|
+
getTypeId() {
|
|
49
52
|
return 53
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
getQuotedFields
|
|
53
|
-
return [
|
|
55
|
+
getQuotedFields() {
|
|
56
|
+
return []
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
/****** IMPORTERS *******/
|
|
57
60
|
|
|
58
|
-
fromBind
|
|
61
|
+
fromBind(opts) {
|
|
59
62
|
// test.example.com 3600 IN SMIMEA, usage, selector, match, data
|
|
60
|
-
const [
|
|
63
|
+
const [owner, ttl, c, type, usage, selector, match] =
|
|
64
|
+
opts.bindline.split(/\s+/)
|
|
61
65
|
return new SMIMEA({
|
|
62
66
|
owner,
|
|
63
|
-
ttl
|
|
64
|
-
class
|
|
65
|
-
type
|
|
66
|
-
'certificate usage'
|
|
67
|
-
selector
|
|
68
|
-
'matching type'
|
|
69
|
-
'certificate association data': opts.bindline
|
|
67
|
+
ttl: parseInt(ttl, 10),
|
|
68
|
+
class: c,
|
|
69
|
+
type: type,
|
|
70
|
+
'certificate usage': parseInt(usage, 10),
|
|
71
|
+
selector: parseInt(selector, 10),
|
|
72
|
+
'matching type': parseInt(match, 10),
|
|
73
|
+
'certificate association data': opts.bindline
|
|
74
|
+
.split(/\s+/)
|
|
75
|
+
.slice(7)
|
|
76
|
+
.join(' ')
|
|
77
|
+
.trim(),
|
|
70
78
|
})
|
|
71
79
|
}
|
|
72
|
-
|
|
73
80
|
}
|