Last active
February 2, 2018 00:37
-
-
Save danshev/393abef73282f79deae13647999b08a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PUBLIC KEY----- | |
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwHOsOx1+fxcN0LRPvilU | |
ZGW++ROdt3TtrbbvLKqzQil1lOVaMKguGMnR65rlwsU11DaQ48i9t+J21cEViv/B | |
HGPguUFLbv0/ZZKw+cw1m1OgM8RDDWDIKqKy5bWWxXu8Hi5X2vg30NOZiychvBhm | |
qeIbgzwKblTU9SynA27x/oncNC8sbaql1KmAQ8W26maKjCLrhSyhwU4sQazrsZ85 | |
rBKhzSvz2LjKnYKCRU/3owK1rHK5M73/DUC4gF3NpG3feSeUrQQLSD+vCIoWpF6S | |
4wT35TNJAUiggPeq/nBfZrqlAllRI71SM5YtHJI0+erI5RTN3NDDfV16kM0xdTkk | |
qQIDAQAB | |
-----END PUBLIC KEY----- | |
val keyString: String = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwHOsOx1+fxcN0LRPvilU\n" + | |
"ZGW++ROdt3TtrbbvLKqzQil1lOVaMKguGMnR65rlwsU11DaQ48i9t+J21cEViv/B\n" + | |
"HGPguUFLbv0/ZZKw+cw1m1OgM8RDDWDIKqKy5bWWxXu8Hi5X2vg30NOZiychvBhm\n" + | |
"qeIbgzwKblTU9SynA27x/oncNC8sbaql1KmAQ8W26maKjCLrhSyhwU4sQazrsZ85\n" + | |
"rBKhzSvz2LjKnYKCRU/3owK1rHK5M73/DUC4gF3NpG3feSeUrQQLSD+vCIoWpF6S\n" + | |
"4wT35TNJAUiggPeq/nBfZrqlAllRI71SM5YtHJI0+erI5RTN3NDDfV16kM0xdTkk\n" + | |
"qQIDAQAB\n" | |
val publicKey = ECKeys().genRSAPublicKeyFromBase64(keyString) | |
>> java.lang.RuntimeException: error:0c0000b1:ASN.1 encoding routines:OPENSSL_internal:TOO_LONG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You've so many new line characters as \n included in the input string. Try to remove them.