Public Key
Hi, I have a key from Java that looks like
OpenSSLRSAPublicKey{modulus=3b11f044.....58df890,publicExponent=10001}
Do I just use the modulus string as the public key or would I need to somehow convert this whole key to another format to use?
Thanks
I think i've managed to get a base64 encoded key from java now, however this code now pauses on line 108 - OSStatus status = SecItemAdd((__bridge CFDictionaryRef)publicKey, &persistKey); And when I click continue in the debugger it carries on as normal however the encoded string is NULL.
Is there an issue when trying with a new key? It's not crashing, just pausing.
Ok, sorry about so many notes. It seems it's pausing with an Exception, as if I remove the exception breakpoint it runs just fine, however the encoded string is always NULL :(
Is the public key string in the format of this form?
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEChqe80lJLTTkJD3X3Lyd7Fj+
zuOhDZkjuLNPog3YR20e5JcrdqI9IFzNbACY/GQVhbnbvBqYgyql8DfPCGXpn0+X
NSxELIUw9Vh32QuhGNr3/TBpechrVeVpFPLwyaYNEk1CawgHCeQqf5uaqiaoBDOT
qeox88Lc1ld7MsfggQIDAQAB
-----END PUBLIC KEY-----
Yes, I can get it working fine if I setup a new iOS project. I was originally using an OSX project. I wonder if it's an issue to do with code signing as I don't have a valid OSX dev membership but do for iOS. For it to use the keychain would it require proper code signing?
I have an OS X CLI project and i'm having the same issue.
108 - OSStatus status = SecItemAdd((__bridge CFDictionaryRef)publicKey, &persistKey); OSStatus = -25303 and return NULL encoded string.
The persistKey appears to be nil after the SecItemAdd.
Hello. I wander how to encrype RSA by two parameters, "Mod“, ”Exp" ?
iOS9 no worked。。。help
@tomguan this link might help http://www.scriptscoop.com/t/b7214526ca56/ios-create-seckey-from-modulus-and-exponent-in-swift.html