proton_pki

    Read PEM-encoded RSA public keys for Proton updates.

    Download zip
    Version
    0.11.0
    License
    Apache-2.0
    Last updated
    2 hours ago
    Downloads
    77

    No dependencies

    #moonbit-community/proton_pki

    parse_rsa_public_key(pem) reads one PEM-encoded RSA public key and returns its modulus and public exponent, in that order. It accepts PKCS#1 (RSA PUBLIC KEY) and SubjectPublicKeyInfo (PUBLIC KEY) with the rsaEncryption algorithm identifier and NULL parameters. PEM lines can end with LF, CRLF, or CR.

    The parser checks the key encoding. The caller owns RSA key policy, including minimum modulus size and permitted exponents. Proton's updater applies this policy through moonbit-community/proton_rsa.

    InvalidKey

    pub suberror InvalidKey {
    InvalidKey(String)
    }

    A PEM envelope or DER structure could not be read as an RSA public key.

    parse_rsa_public_key

    fn parse_rsa_public_key(text : StringView) -> (
    BigInt
    ,
    BigInt
    ) raise InvalidKey

    Reads one PKCS#1 or SubjectPublicKeyInfo PEM public key and returns its modulus and public exponent. The caller enforces RSA key policy.

    Source Files