Lines Matching full:encode
116 int32_t CRYPT_EAL_ParseAsn1PriKey(int32_t type, BSL_Buffer *encode, const BSL_Buffer *pwd, in CRYPT_EAL_ParseAsn1PriKey() argument
123 return ParseEccPrikeyAsn1Buff(encode->data, encode->dataLen, NULL, ealPriKey); in CRYPT_EAL_ParseAsn1PriKey()
127 return ParseRsaPrikeyAsn1Buff(encode->data, encode->dataLen, NULL, BSL_CID_UNKNOWN, in CRYPT_EAL_ParseAsn1PriKey()
131 return ParsePk8PriKeyBuff(encode, ealPriKey); in CRYPT_EAL_ParseAsn1PriKey()
134 return ParsePk8EncPriKeyBuff(encode, pwd, ealPriKey); in CRYPT_EAL_ParseAsn1PriKey()
143 int32_t CRYPT_EAL_ParsePemPriKey(int32_t type, BSL_Buffer *encode, const BSL_Buffer *pwd, in CRYPT_EAL_ParsePemPriKey() argument
152 … ret = BSL_PEM_DecodePemToAsn1((char **)&(encode->data), &(encode->dataLen), &symbol, &(asn1.data), in CRYPT_EAL_ParsePemPriKey()
167 int32_t CRYPT_EAL_ParseUnknownPriKey(int32_t type, BSL_Buffer *encode, const BSL_Buffer *pwd, in CRYPT_EAL_ParseUnknownPriKey() argument
171 bool isPem = BSL_PEM_IsPemFormat((char *)(encode->data), encode->dataLen); in CRYPT_EAL_ParseUnknownPriKey()
173 return CRYPT_EAL_ParsePemPriKey(type, encode, pwd, ealPriKey); in CRYPT_EAL_ParseUnknownPriKey()
176 return CRYPT_EAL_ParseAsn1PriKey(type, encode, pwd, ealPriKey); in CRYPT_EAL_ParseUnknownPriKey()
179 int32_t CRYPT_EAL_PriKeyParseBuff(BSL_ParseFormat format, int32_t type, BSL_Buffer *encode, const B… in CRYPT_EAL_PriKeyParseBuff() argument
182 if (encode == NULL || encode->data == NULL || encode->dataLen == 0 || ealPriKey == NULL) { in CRYPT_EAL_PriKeyParseBuff()
189 return CRYPT_EAL_ParseAsn1PriKey(type, encode, pwd, ealPriKey); in CRYPT_EAL_PriKeyParseBuff()
192 return CRYPT_EAL_ParsePemPriKey(type, encode, pwd, ealPriKey); in CRYPT_EAL_PriKeyParseBuff()
195 return CRYPT_EAL_ParseUnknownPriKey(type, encode, pwd, ealPriKey); in CRYPT_EAL_PriKeyParseBuff()
201 int32_t CRYPT_EAL_ParseAsn1PubKey(int32_t type, BSL_Buffer *encode, CRYPT_EAL_PkeyCtx **ealPubKey) in CRYPT_EAL_ParseAsn1PubKey() argument
205 … return CRYPT_EAL_ParseAsn1SubPubkey(encode->data, encode->dataLen, (void **)ealPubKey, false); in CRYPT_EAL_ParseAsn1PubKey()
207 … return CRYPT_EAL_ParseAsn1SubPubkey(encode->data, encode->dataLen, (void **)ealPubKey, true); in CRYPT_EAL_ParseAsn1PubKey()
210 … return ParseRsaPubkeyAsn1Buff(encode->data, encode->dataLen, NULL, ealPubKey, BSL_CID_UNKNOWN); in CRYPT_EAL_ParseAsn1PubKey()
218 int32_t CRYPT_EAL_ParsePemPubKey(int32_t type, BSL_Buffer *encode, CRYPT_EAL_PkeyCtx **ealPubKey) in CRYPT_EAL_ParsePemPubKey() argument
226 …ret = BSL_PEM_DecodePemToAsn1((char **)&(encode->data), &(encode->dataLen), &symbol, &(asn1.data),… in CRYPT_EAL_ParsePemPubKey()
240 int32_t CRYPT_EAL_ParseUnknownPubKey(int32_t type, BSL_Buffer *encode, CRYPT_EAL_PkeyCtx **ealPubKe… in CRYPT_EAL_ParseUnknownPubKey() argument
243 bool isPem = BSL_PEM_IsPemFormat((char *)(encode->data), encode->dataLen); in CRYPT_EAL_ParseUnknownPubKey()
245 return CRYPT_EAL_ParsePemPubKey(type, encode, ealPubKey); in CRYPT_EAL_ParseUnknownPubKey()
248 return CRYPT_EAL_ParseAsn1PubKey(type, encode, ealPubKey); in CRYPT_EAL_ParseUnknownPubKey()
251 int32_t CRYPT_EAL_PubKeyParseBuff(BSL_ParseFormat format, int32_t type, BSL_Buffer *encode, in CRYPT_EAL_PubKeyParseBuff() argument
254 if (encode == NULL || encode->data == NULL || encode->dataLen == 0 || ealPubKey == NULL) { in CRYPT_EAL_PubKeyParseBuff()
261 return CRYPT_EAL_ParseAsn1PubKey(type, encode, ealPubKey); in CRYPT_EAL_PubKeyParseBuff()
264 return CRYPT_EAL_ParsePemPubKey(type, encode, ealPubKey); in CRYPT_EAL_PubKeyParseBuff()
267 return CRYPT_EAL_ParseUnknownPubKey(type, encode, ealPubKey); in CRYPT_EAL_PubKeyParseBuff()
273 …_t CRYPT_EAL_UnKnownKeyParseBuff(BSL_ParseFormat format, const BSL_Buffer *pwd, BSL_Buffer *encode, in CRYPT_EAL_UnKnownKeyParseBuff() argument
278 ret = CRYPT_EAL_PriKeyParseBuff(format, type, encode, pwd, ealPKey); in CRYPT_EAL_UnKnownKeyParseBuff()
285 ret = CRYPT_EAL_PubKeyParseBuff(format, type, encode, ealPKey); in CRYPT_EAL_UnKnownKeyParseBuff()
294 int32_t CRYPT_EAL_DecodeBuffKey(int32_t format, int32_t type, BSL_Buffer *encode, in CRYPT_EAL_DecodeBuffKey() argument
307 return CRYPT_EAL_PriKeyParseBuff(format, type, encode, &pwdBuffer, ealPKey); in CRYPT_EAL_DecodeBuffKey()
313 return CRYPT_EAL_PubKeyParseBuff(format, type, encode, ealPKey); in CRYPT_EAL_DecodeBuffKey()
315 return CRYPT_EAL_UnKnownKeyParseBuff(format, &pwdBuffer, encode, ealPKey); in CRYPT_EAL_DecodeBuffKey()
333 BSL_Buffer encode = {data, dataLen}; in CRYPT_EAL_PriKeyParseFile() local
334 ret = CRYPT_EAL_PriKeyParseBuff(format, type, &encode, pwd, ealPriKey); in CRYPT_EAL_PriKeyParseFile()
348 BSL_Buffer encode = {data, dataLen}; in CRYPT_EAL_PubKeyParseFile() local
349 ret = CRYPT_EAL_PubKeyParseBuff(format, type, &encode, ealPubKey); in CRYPT_EAL_PubKeyParseFile()
364 BSL_Buffer encode = {data, dataLen}; in CRYPT_EAL_UnKnownKeyParseFile() local
365 ret = CRYPT_EAL_UnKnownKeyParseBuff(format, pwd, &encode, ealKey); in CRYPT_EAL_UnKnownKeyParseFile()
435 const CRYPT_EncodeParam *encodeParam, int32_t type, BSL_Buffer *encode) in CRYPT_EAL_EncodeAsn1PriKey() argument
445 return EncodeEccPrikeyAsn1Buff(ealPriKey, NULL, encode); in CRYPT_EAL_EncodeAsn1PriKey()
449 return EncodeRsaPrikeyAsn1Buff(ealPriKey, CRYPT_PKEY_RSA, encode); in CRYPT_EAL_EncodeAsn1PriKey()
452 return EncodePk8PriKeyBuff(ealPriKey, encode); in CRYPT_EAL_EncodeAsn1PriKey()
455 return EncodePk8EncPriKeyBuff(libCtx, attrName, ealPriKey, encodeParam, encode); in CRYPT_EAL_EncodeAsn1PriKey()
465 const CRYPT_EncodeParam *encodeParam, int32_t type, BSL_Buffer *encode) in CRYPT_EAL_EncodePemPriKey() argument
479 …ret = BSL_PEM_EncodeAsn1ToPem(asn1.data, asn1.dataLen, &symbol, (char **)&encode->data, &encode->d… in CRYPT_EAL_EncodePemPriKey()
489 const CRYPT_EncodeParam *encodeParam, BSL_ParseFormat format, int32_t type, BSL_Buffer *encode) in CRYPT_EAL_PriKeyEncodeBuff() argument
491 if (ealPriKey == NULL || encode == NULL) { in CRYPT_EAL_PriKeyEncodeBuff()
498 … return CRYPT_EAL_EncodeAsn1PriKey(libCtx, attrName, ealPriKey, encodeParam, type, encode); in CRYPT_EAL_PriKeyEncodeBuff()
501 … return CRYPT_EAL_EncodePemPriKey(libCtx, attrName, ealPriKey, encodeParam, type, encode); in CRYPT_EAL_PriKeyEncodeBuff()
510 BSL_ParseFormat format, int32_t type, BSL_Buffer *encode) in CRYPT_EAL_PubKeyEncodeBuff() argument
512 return CRYPT_EAL_EncodePubKeyBuffInternal(ealPubKey, format, type, true, encode); in CRYPT_EAL_PubKeyEncodeBuff()
516 const CRYPT_EncodeParam *encodeParam, int32_t format, int32_t type, BSL_Buffer *encode) in ProviderEncodeBuffKeyInternal() argument
527 … return CRYPT_EAL_PriKeyEncodeBuff(libCtx, attrName, ealPKey, encodeParam, format, type, encode); in ProviderEncodeBuffKeyInternal()
532 return CRYPT_EAL_PubKeyEncodeBuff(ealPKey, format, type, encode); in ProviderEncodeBuffKeyInternal()
540 const CRYPT_EncodeParam *encodeParam, const char *format, const char *type, BSL_Buffer *encode) in CRYPT_EAL_ProviderEncodeBuffKey() argument
544 …derEncodeBuffKeyInternal(libCtx, attrName, ealPKey, encodeParam, encodeFormat, encodeType, encode); in CRYPT_EAL_ProviderEncodeBuffKey()
548 int32_t format, int32_t type, BSL_Buffer *encode) in CRYPT_EAL_EncodeBuffKey() argument
550 return ProviderEncodeBuffKeyInternal(NULL, NULL, ealPKey, encodeParam, format, type, encode); in CRYPT_EAL_EncodeBuffKey()
554 int32_t type, bool isComplete, BSL_Buffer *encode) in CRYPT_EAL_EncodeAsn1PubKey() argument
558 return CRYPT_EAL_EncodeAsn1SubPubkey(ealPubKey, isComplete, encode); in CRYPT_EAL_EncodeAsn1PubKey()
561 return EncodeRsaPubkeyAsn1Buff(ealPubKey, NULL, encode); in CRYPT_EAL_EncodeAsn1PubKey()
571 int32_t type, bool isComplete, BSL_Buffer *encode) in CRYPT_EAL_EncodePemPubKey() argument
585 …ret = BSL_PEM_EncodeAsn1ToPem(asn1.data, asn1.dataLen, &symbol, (char **)&encode->data, &encode->d… in CRYPT_EAL_EncodePemPubKey()
595 BSL_ParseFormat format, int32_t type, bool isComplete, BSL_Buffer *encode) in CRYPT_EAL_EncodePubKeyBuffInternal() argument
597 if (ealPubKey == NULL || encode == NULL) { in CRYPT_EAL_EncodePubKeyBuffInternal()
604 return CRYPT_EAL_EncodeAsn1PubKey(ealPubKey, type, isComplete, encode); in CRYPT_EAL_EncodePubKeyBuffInternal()
607 return CRYPT_EAL_EncodePemPubKey(ealPubKey, type, isComplete, encode); in CRYPT_EAL_EncodePubKeyBuffInternal()
619 BSL_Buffer encode = {0}; in CRYPT_EAL_PriKeyEncodeFile() local
620 … ret = CRYPT_EAL_PriKeyEncodeBuff(libCtx, attrName, ealPriKey, encodeParam, format, type, &encode); in CRYPT_EAL_PriKeyEncodeFile()
625 ret = BSL_SAL_WriteFile(path, encode.data, encode.dataLen); in CRYPT_EAL_PriKeyEncodeFile()
629 BSL_SAL_Free(encode.data); in CRYPT_EAL_PriKeyEncodeFile()
635 BSL_Buffer encode = {0}; in CRYPT_EAL_PubKeyEncodeFile() local
636 int32_t ret = CRYPT_EAL_PubKeyEncodeBuff(ealPubKey, format, type, &encode); in CRYPT_EAL_PubKeyEncodeFile()
641 ret = BSL_SAL_WriteFile(path, encode.data, encode.dataLen); in CRYPT_EAL_PubKeyEncodeFile()
645 BSL_SAL_FREE(encode.data); in CRYPT_EAL_PubKeyEncodeFile()