<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<div>
<blockquote dir="auto">
<p>The <a href="https://tools.ietf.org/html/rfc6376#section-3.6.1" rel="nofollow noreferrer noopener" target="_blank">DKIM base specification</a> states for the k= flag “The "rsa" key type indicates that an ASN.1 DER-encoded [ITU-X660-1997] RSAPublicKey (see [RFC3447], Sections 3.1 and A.1.1) is being used in the "p=" tag.".  The p= flag is a single, base64 encoded string.” The key-data is imported using <a href="https://www.gnutls.org/manual/html_node/Abstract-key-API.html#gnutls_005fpubkey_005fimport" rel="nofollow noreferrer noopener" target="_blank">gnutls_pubkey_import</a>.</p>
</blockquote>
<blockquote dir="auto">
<ul>
<li>Write in the documentation that gnutls_pubkey_import deals with ASN.1 data
<a href="https://tools.ietf.org/html/rfc8463#section-4.2" rel="nofollow noreferrer noopener" target="_blank">RFC8463 extends</a> the base DKIM specification: “The p= value in the key record is the Ed25519 public key encoded in base64.”</li>
</ul>
</blockquote>
<p dir="auto">Hi,
All gnutls import and export functions deal with X.509 (ASN-encoded) data. In particular <code>gnutls_pubkey_import</code> is documented to import a <code>SubjectPublicKeyInfo X.509 structure</code>, and not the structures described in RFC8463. Note also that gnutls doesn't claim to implement RFC8463.</p>
<blockquote dir="auto">
<p>What function shall be used to import that data? / How shall the key from DNS be imported into a public key, after the base64 decoding?</p>
</blockquote>
<p dir="auto">RFC8463 seems to be using raw keys, and thus you'd need to use <code>gnutls_pubkey_import_ecc_raw</code>. You may want to see how the knot dns guys have implemented that part.</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/613#note_116279842">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/ee1fa0a6ceaae8674155068430b65227/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/issues/613#note_116279842"}}</script>
</p>
</div>
</body>
</html>