Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Credentials & Tidal
22-06-2015, 07:15 PM
Post: #8
RE: Credentials & Tidal
(22-06-2015 04:05 PM)Josef Wrote:  GetPublicKey() is never called - Kazoo only calls Get(). Is there some special Status that needs to be passed too?
There is a PublicKey state variable in Credentials. Kazoo reads this via a subscription.

(22-06-2015 04:05 PM)Josef Wrote:  BTW - How do I know if PublicKey is valid? I used this link (http://travistidwell.com/jsencrypt/demo/) to generate a key and in CredentialProvider constructor set it like this:

SetPropertyPublicKey("MFswDQYJKoZIhvcNAQEBBQADSgAwRwJAXpZI1Ilhodm3XPZtRDSfwX6UO14MqII5yI5sPUiYk4B1x/9fTvEEdL4tliZmNQ07mFAxLa/RMtFVC3r2dHqcgQIDAQAB");

GetPublickKey() just does:
GetPropertyPublicKey(aPublicKey);

But your guess might be on to something: I've just tried with Bubble on Android and it _does_ call GetPublicKey() but then also crashes - So at least we have some consistency here Smile

Hmmm - Is that public key OK?

That doesn't look right. The Credentials service on Linn DS reports a much longer key in the form

-----BEGIN RSA PUBLIC KEY-----
380 chars in 64 char lines
-----END RSA PUBLIC KEY-----


The key is generated using openssl with code like
Code:
RAND_seed(aEntropy.Ptr(), aEntropy.Bytes());
BIGNUM *bn = BN_new();
ASSERT(BN_set_word(bn, RSA_F4));
RSA* rsa = RSA_new();
ASSERT(rsa != NULL);
ASSERT(RSA_generate_key_ex(rsa, aKeyBits, bn, NULL));
BN_free(bn);

BIO* bio = BIO_new(BIO_s_mem());
ASSERT(bio != NULL);
// skip code to persist key
ASSERT(1 == PEM_write_bio_RSAPublicKey(bio, rsa));
const int len = BIO_pending(aBio);
char* val = (char*)calloc(len+1, 1);
ASSERT(val != NULL);
BIO_read(aBio, val, len);
// set 'val' into Credentials PublicKey
Find all posts by this user


Messages In This Thread
Credentials & Tidal - Josef - 22-06-2015, 12:05 PM
RE: Credentials & Tidal - simonc - 22-06-2015, 12:24 PM
RE: Credentials & Tidal - Josef - 22-06-2015, 12:42 PM
RE: Credentials & Tidal - simonc - 22-06-2015, 02:16 PM
RE: Credentials & Tidal - Josef - 22-06-2015, 02:47 PM
RE: Credentials & Tidal - simonc - 22-06-2015, 03:36 PM
RE: Credentials & Tidal - Josef - 22-06-2015, 04:05 PM
RE: Credentials & Tidal - simonc - 22-06-2015 07:15 PM
RE: Credentials & Tidal - Josef - 22-06-2015, 08:00 PM
RE: Credentials & Tidal - simonc - 22-06-2015, 09:11 PM
RE: Credentials & Tidal - Josef - 22-06-2015, 10:09 PM
RE: Credentials & Tidal - simonc - 23-06-2015, 12:44 PM
RE: Credentials & Tidal - Josef - 23-06-2015, 01:56 PM
RE: Credentials & Tidal - simonc - 23-06-2015, 01:59 PM
RE: Credentials & Tidal - Josef - 23-06-2015, 02:06 PM
RE: Credentials & Tidal - simonc - 23-06-2015, 02:52 PM
RE: Credentials & Tidal - Josef - 23-06-2015, 04:46 PM

Forum Jump: