Documentation
This commit is contained in:
parent
3069fd41a2
commit
5a7fb7a15f
|
@ -206,8 +206,7 @@ func TestTag(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKeyRSA(t *testing.T) {
|
||||
|
||||
return // Tijdelijk uit TODO(mg)
|
||||
//return // Tijdelijk uit TODO(mg)
|
||||
key := new(RR_DNSKEY)
|
||||
key.Hdr.Name = "miek.nl."
|
||||
key.Hdr.Rrtype = TypeDNSKEY
|
||||
|
@ -241,6 +240,7 @@ func TestKeyRSA(t *testing.T) {
|
|||
sig.SignerName = "miek.nl."
|
||||
|
||||
sig.Sign(priv, []RR{soa})
|
||||
// Not actually doing with the data... What should I test
|
||||
//s := key.PrivateKeyString(priv)
|
||||
}
|
||||
|
||||
|
|
|
@ -67,10 +67,10 @@ func (r *RR_DNSKEY) Generate(bits int) (PrivateKey, error) {
|
|||
return nil, nil // Dummy return
|
||||
}
|
||||
|
||||
// Convert a PrivateKey to a string. This
|
||||
// PrivateKeyString converts a PrivateKey to a string. This
|
||||
// string has the same format as the private-key-file of BIND9 (Private-key-format: v1.3).
|
||||
// It needs some info from the key (hashing, keytag), so its a method of the RR_DNSKEY.
|
||||
func (r *RR_DNSKEY) PrivateKeyToString(p PrivateKey) (s string) {
|
||||
func (r *RR_DNSKEY) PrivateKeyString(p PrivateKey) (s string) {
|
||||
switch t := p.(type) {
|
||||
case *rsa.PrivateKey:
|
||||
algorithm := strconv.Itoa(int(r.Algorithm)) + " (" + Alg_str[r.Algorithm] + ")"
|
||||
|
@ -105,7 +105,7 @@ func (r *RR_DNSKEY) PrivateKeyToString(p PrivateKey) (s string) {
|
|||
"Exponent2: " + exponent2 + "\n" +
|
||||
"Coefficient: " + coefficient + "\n"
|
||||
case *ecdsa.PrivateKey:
|
||||
//
|
||||
s = "TODO"
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
2
tsig.go
2
tsig.go
|
@ -77,7 +77,7 @@ type timerWireFmt struct {
|
|||
Fudge uint16
|
||||
}
|
||||
|
||||
// TsigGenerate add add TSIG RR to a message. The TSIG MAC is saved
|
||||
// TsigGenerate adds an TSIG RR to a message. The TSIG MAC is saved
|
||||
// in the Tsig RR that is added. When TsigGenerate is called for the
|
||||
// first time requestMAC is set to the empty string.
|
||||
// If something goes wrong an error is returned, otherwise it is nil.
|
||||
|
|
Loading…
Reference in New Issue