You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found some info. It looks like it is because 124 characters contains some more info. So I attempted to generate 88 characters using Bouncy Castle ASN1Primitive.
But the output as follow doesn't contain any 88 characters string I am looking for. It seems to me the last 3 line are what I after, but I do not find corresponded conversion methods.
Sequence
Sequence
ObjectIdentifier(1.2.840.10045.2.1)
ObjectIdentifier(1.2.840.10045.3.1.7)
DER Bit String[65, 0]
046b89ae9a8f38f5651982e4550480cd2c9affe70998faeace6ac6fcd14d4e46 k8eU,jMNF
1f35ad7536aec9864b5ced0b1eeade2792f60ada04b3deea58c97923f2612597 5u6K\'Xy#a%
45
Using ASN1UniversalString, at runtime it throws encoding error getInstance: java.lang.IllegalStateException: unexpected object: org.bouncycastle.asn1.DLSequence. What is the right way to convert the 88 characters public key from and to 124 characters, and vice versa?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I use following Java 11 code to produce a public key. And I notice that the base64 encoding's public key length is 124 characters.
I found some info. It looks like it is because 124 characters contains some more info. So I attempted to generate 88 characters using Bouncy Castle ASN1Primitive.
But the output as follow doesn't contain any 88 characters string I am looking for. It seems to me the last 3 line are what I after, but I do not find corresponded conversion methods.
Using ASN1UniversalString, at runtime it throws
encoding error getInstance: java.lang.IllegalStateException: unexpected object: org.bouncycastle.asn1.DLSequence
. What is the right way to convert the 88 characters public key from and to 124 characters, and vice versa?Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions