a-sit-plus / signum

Kotlin Multiplatform Crypto/PKI Library and ASN1 Parser + Encoder
https://a-sit-plus.github.io/signum/
Apache License 2.0
76 stars 6 forks source link

`jcaName`/`parseFromJca` #87

Open iaik-jheher opened 5 months ago

iaik-jheher commented 5 months ago

parseFromJca returns unqualified CryptoSignature; .rawByteEncodable would be nice.

To do this, we would need the JCA to give us raw byte signatures, not DER encoded. This is standardized.

We could change the jcaName on X509SignatureAlgorithm to the P1363 version, and update parseFromJca to match. But: this would explode if the two are not used in concert, but signature strings are manually pfusched.

Food for thought. It'll probably be irrelevant once we merge the Signer work.

JesusMcCloud commented 5 months ago

Just keep in mind that the outside world exists and there's lots of code out there on the JVM that does not respect such a convention. But I do agree that it will be far less relevant when the signer is done

iaik-jheher commented 5 months ago

jcaName no longer exists, so this would be an update to the getJCASigner method instead.

I still think it'd make sense to do; document it on parseJCA..., and anyone insistent on using the plain version can just use decodeFromDER directly?

JesusMcCloud commented 4 months ago

we will need to verify these identifers work on Android too

JesusMcCloud commented 2 months ago

closing this. I think we have everything we need

iaik-jheher commented 2 months ago

@JesusMcCloud did we end up doing this?

JesusMcCloud commented 2 months ago

you implemented the following and I think this is everything we need

iaik-jheher commented 2 months ago

The issue was about changing what JCA algorithm string is used by those methods, and correspondingly what signature encoding format parseFromJca (without P1363 suffix) expects.

(So unless you made further changes, the issue is not resolved.)