Skip to content

Does this library support interop with pycrypto? #41

Answered by whyoleg
ColtonIdle asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! Yeah, there is no need to provide fips-186-3, this is the default behaviour now. So everything should work fine.
The main difference with this python library is that you don't need to hash data yourself, but it will be done under the hood.

So to mimic your code here, it will be something like this:

val ecdsa = CryptographyProvider.Default.get(ECDSA)
val signature =
    ecdsa
        .privateKeyDecoder(EC.Curve.P521)
        .decodeFrom(EC.PrivateKey.Format.DER, TODO("read bytes from 'privkey.der'"))
        .signatureGenerator(SHA256, ECDSA.SignatureFormat.RAW) // python lib used RAW format by default
        .generateSignature("I give my permission to order #4355".encodeToByteArray(…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ColtonIdle
Comment options

@whyoleg
Comment options

@ColtonIdle
Comment options

@whyoleg
Comment options

@ColtonIdle
Comment options

Answer selected by ColtonIdle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants