Documentation
¶
Overview ¶
Package convert contains functions to innitialize Tink keysets from PEM-encoded data.
Index ¶
- func PemFromECDSAP256Sha256WithDEREncodingKeysetHandle(handle *keyset.Handle) ([]byte, error)
- func PemFromRsaSsaPkcs1Sha256KeysetHandle(handle *keyset.Handle) ([]byte, error)
- func PemToECDSAP256Sha256WithDEREncodingKeysetHandle(pemBytes []byte) (*keyset.Handle, error)
- func PemToRsaSsaPkcs1Sha256KeysetHandle(pemBytes []byte) (*keyset.Handle, error)
- func PemToRsaSsaPssSha256KeysetHandle(pemBytes []byte) (*keyset.Handle, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PemFromECDSAP256Sha256WithDEREncodingKeysetHandle ¶
PemFromECDSAP256Sha256WithDEREncodingKeysetHandle converts a Tink Keyset with one EcdsaPublicKey (over curve P-256 using SHA256 and DER signature encoding) into a PEM-encoded key.
Note that the PEM encoded key does not have all the metadata the Tink key has. This can produce unexpected incompatibilities, see https://developers.google.com/tink/design/access_control#accessing_partial_keys
func PemFromRsaSsaPkcs1Sha256KeysetHandle ¶
PemFromRsaSsaPkcs1Sha256KeysetHandle converts a Tink Keyset with one RsaSsaPkcs1PublicKey (using SHA256) into a PEM-encoded key.
Note that the PEM encoded key does not have all the metadata the Tink key has. This can produce unexpected incompatibilities, see https://developers.google.com/tink/design/access_control#accessing_partial_keys
func PemToECDSAP256Sha256WithDEREncodingKeysetHandle ¶
PemToECDSAP256Sha256WithDEREncodingKeysetHandle converts a PEM-encoded byte slice into a Tink public Keyset.
ECDSA Signatures need to used the ASN.1 DER encoding.
The JWA RFC for ES256, ES384 and ES512 mandates a different encoding, so this generated with this class are not conformant with the JWA standard. See https://www.rfc-editor.org/rfc/rfc7518#section-3.4.
func PemToRsaSsaPkcs1Sha256KeysetHandle ¶
PemToRsaSsaPkcs1Sha256KeysetHandle converts a PEM-encoded byte slice into a Tink public Keyset.
Note that only OID "rsaEncryption" is supported. The OIDs "sha256WithRSAEncryption", "sha384WithRSAEncryption" and "sha512WithRSAEncryption" are not supported. See RFC 4055 Section 1.2 and Section 5 for a discussion of these OIDs.
func PemToRsaSsaPssSha256KeysetHandle ¶
PemToRsaSsaPssSha256KeysetHandle converts a PEM-encoded byte slice into a Tink public Keyset.
Note that only OID "rsaEncryption" is supported. The OID "id-RSASSA-PSS" is not supported. See RFC 4055 Section 1.2 for a discussion of these OIDs.
Types ¶
This section is empty.