Re: [Cryptography-dev] Validate SSH key
Thanks a lot Alex. Best, Seyed On Mon, Feb 28, 2022 at 6:32 PM Alex Gaynor wrote: > > Sure, then the parse function in cryptography should do what you want > -- it will either return a public key or raise an exception. > > Alex > > On Mon, Feb 28, 2022 at 9:57 AM Seyed Mohammad Fakhraie > wrote: > > > > Hey Alex, > > Thanks for getting back. My bad. I meant SSH public keys. I want to > > make sure that the string which I'm receiving is a valid SSH public > > key. > > > > On Mon, Feb 28, 2022 at 6:13 PM Alex Gaynor wrote: > > > > > > What does it mean to you to validate an SSH key? > > > > > > pyOpenSSL does not have any functions for interacting with > > > SSH-formatted keys. cryptography has a function for parsing them: > > > https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/#openssh-public-key > > > > > > Alex > > > > > > On Mon, Feb 28, 2022 at 9:40 AM Seyed Mohammad Fakhraie > > > wrote: > > > > > > > > Greetings, > > > > I'm receiving encoded SSH keys from the user which I need to validate. > > > > Does pyopenssl have a function for validating SSH keys? > > > > ___ > > > > Cryptography-dev mailing list > > > > Cryptography-dev@python.org > > > > https://mail.python.org/mailman/listinfo/cryptography-dev > > > > > > > > > > > > -- > > > All that is necessary for evil to succeed is for good people to do > > > nothing. > > > ___ > > > Cryptography-dev mailing list > > > Cryptography-dev@python.org > > > https://mail.python.org/mailman/listinfo/cryptography-dev > > ___ > > Cryptography-dev mailing list > > Cryptography-dev@python.org > > https://mail.python.org/mailman/listinfo/cryptography-dev > > > > -- > All that is necessary for evil to succeed is for good people to do nothing. > ___ > Cryptography-dev mailing list > Cryptography-dev@python.org > https://mail.python.org/mailman/listinfo/cryptography-dev ___ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev
Re: [Cryptography-dev] Validate SSH key
Sure, then the parse function in cryptography should do what you want -- it will either return a public key or raise an exception. Alex On Mon, Feb 28, 2022 at 9:57 AM Seyed Mohammad Fakhraie wrote: > > Hey Alex, > Thanks for getting back. My bad. I meant SSH public keys. I want to > make sure that the string which I'm receiving is a valid SSH public > key. > > On Mon, Feb 28, 2022 at 6:13 PM Alex Gaynor wrote: > > > > What does it mean to you to validate an SSH key? > > > > pyOpenSSL does not have any functions for interacting with > > SSH-formatted keys. cryptography has a function for parsing them: > > https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/#openssh-public-key > > > > Alex > > > > On Mon, Feb 28, 2022 at 9:40 AM Seyed Mohammad Fakhraie > > wrote: > > > > > > Greetings, > > > I'm receiving encoded SSH keys from the user which I need to validate. > > > Does pyopenssl have a function for validating SSH keys? > > > ___ > > > Cryptography-dev mailing list > > > Cryptography-dev@python.org > > > https://mail.python.org/mailman/listinfo/cryptography-dev > > > > > > > > -- > > All that is necessary for evil to succeed is for good people to do nothing. > > ___ > > Cryptography-dev mailing list > > Cryptography-dev@python.org > > https://mail.python.org/mailman/listinfo/cryptography-dev > ___ > Cryptography-dev mailing list > Cryptography-dev@python.org > https://mail.python.org/mailman/listinfo/cryptography-dev -- All that is necessary for evil to succeed is for good people to do nothing. ___ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev
Re: [Cryptography-dev] Validate SSH key
Hey Alex, Thanks for getting back. My bad. I meant SSH public keys. I want to make sure that the string which I'm receiving is a valid SSH public key. On Mon, Feb 28, 2022 at 6:13 PM Alex Gaynor wrote: > > What does it mean to you to validate an SSH key? > > pyOpenSSL does not have any functions for interacting with > SSH-formatted keys. cryptography has a function for parsing them: > https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/#openssh-public-key > > Alex > > On Mon, Feb 28, 2022 at 9:40 AM Seyed Mohammad Fakhraie > wrote: > > > > Greetings, > > I'm receiving encoded SSH keys from the user which I need to validate. > > Does pyopenssl have a function for validating SSH keys? > > ___ > > Cryptography-dev mailing list > > Cryptography-dev@python.org > > https://mail.python.org/mailman/listinfo/cryptography-dev > > > > -- > All that is necessary for evil to succeed is for good people to do nothing. > ___ > Cryptography-dev mailing list > Cryptography-dev@python.org > https://mail.python.org/mailman/listinfo/cryptography-dev ___ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev
Re: [Cryptography-dev] Validate SSH key
What does it mean to you to validate an SSH key? pyOpenSSL does not have any functions for interacting with SSH-formatted keys. cryptography has a function for parsing them: https://cryptography.io/en/latest/hazmat/primitives/asymmetric/serialization/#openssh-public-key Alex On Mon, Feb 28, 2022 at 9:40 AM Seyed Mohammad Fakhraie wrote: > > Greetings, > I'm receiving encoded SSH keys from the user which I need to validate. > Does pyopenssl have a function for validating SSH keys? > ___ > Cryptography-dev mailing list > Cryptography-dev@python.org > https://mail.python.org/mailman/listinfo/cryptography-dev -- All that is necessary for evil to succeed is for good people to do nothing. ___ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev
[Cryptography-dev] Validate SSH key
Greetings, I'm receiving encoded SSH keys from the user which I need to validate. Does pyopenssl have a function for validating SSH keys? ___ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev