Documentation ¶
Index ¶
- func CheckMessageSignatures(msg *message.Message, publicKey keys.PublicKey) bool
- func CheckSectionSignatures(s section.WithSig, pkeys map[keys.PublicKeyID][]keys.PublicKey, ...) bool
- func CheckSignatureNotExpired(s section.WithSig) bool
- func CheckStringFields(s section.Section) bool
- func SignMessage(msg *message.Message, privateKey interface{}, sig signature.Sig) bool
- func SignMessageUnsafe(msg *message.Message, privateKey interface{}, sig signature.Sig) bool
- func SignSection(s section.WithSig, privateKey interface{}, sig signature.Sig) bool
- func SignSectionUnsafe(s section.WithSig, privateKey interface{}, sig signature.Sig) bool
- func ValidSectionAndSignature(s section.WithSig) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMessageSignatures ¶
CheckMessageSignatures verifies all signatures on the message. Signatures that are not valid now are removed. Returns true if at least one signature is valid and all signatures are correct.
Process is defined as:
- check that there is at least one signature
- check that string fields do not contain <whitespace>:<non whitespace>:<whitespace>
- sort message
- encode message
- sign the encoding and compare the resulting signature data with the signature data received with the message. The encoding of the signature meta data is added in the verifySignature() method
func CheckSectionSignatures ¶
func CheckSectionSignatures(s section.WithSig, pkeys map[keys.PublicKeyID][]keys.PublicKey, maxVal util.MaxCacheValidity) bool
CheckSectionSignatures verifies all signatures on the section. Expired signatures are removed. Returns true if all signatures are correct. The content of a shard or zone must be sorted. If it is not, then the signature verification will fail.
Process is defined as:
- check that there is at least one signature
- check that string fields do not contain <whitespace>:<non whitespace>:<whitespace>
- encode section
- sign the encoding and compare the resulting signature data with the signature data received with the section. The encoding of the signature meta data is added in the verifySignature() method
func CheckSignatureNotExpired ¶
CheckSignatureNotExpired returns true if s is nil or all the signatures ValidUntil are in the future
func CheckStringFields ¶
CheckStringFields returns true if non of the string fields of the given section contain a zone file type marker. It panics if the interface s contains a type but the interfaces value is nil
func SignMessage ¶
SignMessage signs a message with the given private Key and adds the resulting bytestring to the given signature. Signatures with validUntil in the past are not signed and added Returns false if the signature was not added to the message
Process is defined as:
- check that the signature's ValidUntil is in the future
- check that string fields do not contain <whitespace>:<non whitespace>:<whitespace>
- sort message
- encode message
- sign the encoding and add it to the signature which will then be added to the message. The encoding of the signature meta data is added in the verifySignature() method
func SignMessageUnsafe ¶
SignMessageUnsafe signs a message with the given private Key and adds the resulting bytestring to the given signature. The messages content must already be sorted. It does not check the validity of the signature or the message. Returns false if the signature was not added to the message. FIXME: Note that this function only works if one signature is added. Otherwise the cbor marshaller also adds the previous signature to encoding which leads to a different signature.
func SignSection ¶
SignSection signs a section with the given private Key and adds the resulting bytestring to the given signature. Signatures with validUntil in the past are not signed and added Returns false if the signature was not added to the section
Process is defined as:
- check that the signature's ValidUntil is in the future
- check that string fields do not contain <whitespace>:<non whitespace>:<whitespace>
- sort section
- encode section
- sign the encoding and add it to the signature which will then be added to the section. The encoding of the signature meta data is added in the verifySignature() method
func SignSectionUnsafe ¶
SignSectionUnsafe signs a section with the given private Key and adds the resulting bytestring to the given signatures. The shard's or zone's content must already be sorted. It does not check the validity of the signature or the section. Returns false if the signature was not added to the section. FIXME: Note that this function only works if one signature is added. Otherwise the cbor marshaller also adds the previous signature to encoding which leads to a different signature.
func ValidSectionAndSignature ¶
ValidSectionAndSignature returns true if the section is not nil, all the signatures ValidUntil are in the future, the string fields do not contain <whitespace>:<non whitespace>:<whitespace>, and the section's content is sorted (by sorting it).
Types ¶
This section is empty.