2015-09-15 23:55:26 +00:00
|
|
|
from moto.ec2 import utils
|
|
|
|
|
2019-05-25 10:17:52 +00:00
|
|
|
from .helpers import rsa_check_private_key
|
|
|
|
|
2015-09-15 23:55:26 +00:00
|
|
|
|
|
|
|
def test_random_key_pair():
|
|
|
|
key_pair = utils.random_key_pair()
|
2019-10-31 15:44:26 +00:00
|
|
|
rsa_check_private_key(key_pair["material"])
|
2019-05-25 10:17:52 +00:00
|
|
|
|
|
|
|
# AWS uses MD5 fingerprints, which are 47 characters long, *not* SHA1
|
|
|
|
# fingerprints with 59 characters.
|
2019-10-31 15:44:26 +00:00
|
|
|
assert len(key_pair["fingerprint"]) == 47
|