MCPcopy Create free account
hub / github.com/mpdavis/python-jose / test_cryptography_RSA_key_instance

Function test_cryptography_RSA_key_instance

tests/algorithms/test_RSA.py:225–237  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 None in (default_backend, pyca_rsa, CryptographyRSAKey), reason="Cryptography backend not available"
224)
225def test_cryptography_RSA_key_instance():
226 key = pyca_rsa.RSAPublicNumbers(
227 int(65537),
228 int(
229 26057131595212989515105618545799160306093557851986992545257129318694524535510983041068168825614868056510242030438003863929818932202262132630250203397069801217463517914103389095129323580576852108653940669240896817348477800490303630912852266209307160550655497615975529276169196271699168537716821419779900117025818140018436554173242441334827711966499484119233207097432165756707507563413323850255548329534279691658369466534587631102538061857114141268972476680597988266772849780811214198186940677291891818952682545840788356616771009013059992237747149380197028452160324144544057074406611859615973035412993832273216732343819
230 ),
231 ).public_key(default_backend())
232
233 pubkey = CryptographyRSAKey(key, ALGORITHMS.RS256)
234 assert pubkey.is_public()
235
236 pem = pubkey.to_pem()
237 assert pem.startswith(b"-----BEGIN PUBLIC KEY-----")
238
239
240@pytest.mark.cryptography

Callers

nothing calls this directly

Calls 4

is_publicMethod · 0.95
to_pemMethod · 0.95
CryptographyRSAKeyClass · 0.90
public_keyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…