Changeset 74295 in vbox for trunk/src/VBox/Runtime/common/crypto/key.cpp
- Timestamp:
- Sep 16, 2018 3:36:08 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/key.cpp
r74052 r74295 357 357 } 358 358 359 360 RTDECL(int) RTCrKeyQueryRsaModulus(RTCRKEY hKey, PRTBIGNUM pModulus) 361 { 362 PRTCRKEYINT pThis = hKey; 363 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 364 AssertReturn(pThis->u32Magic == RTCRKEYINT_MAGIC, VERR_INVALID_HANDLE); 365 AssertReturn(pThis->enmType == RTCRKEYTYPE_RSA_PRIVATE || pThis->enmType == RTCRKEYTYPE_RSA_PUBLIC, VERR_WRONG_TYPE); 366 AssertPtrReturn(pModulus, VERR_INVALID_POINTER); 367 368 if (pThis->enmType == RTCRKEYTYPE_RSA_PRIVATE) 369 return RTBigNumAssign(pModulus, &pThis->u.RsaPrivate.Modulus); 370 return RTBigNumAssign(pModulus, &pThis->u.RsaPublic.Modulus); 371 } 372 373 374 RTDECL(int) RTCrKeyQueryRsaPrivateExponent(RTCRKEY hKey, PRTBIGNUM pPrivateExponent) 375 { 376 PRTCRKEYINT pThis = hKey; 377 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 378 AssertReturn(pThis->u32Magic == RTCRKEYINT_MAGIC, VERR_INVALID_HANDLE); 379 AssertReturn(pThis->enmType == RTCRKEYTYPE_RSA_PRIVATE, VERR_WRONG_TYPE); 380 AssertPtrReturn(pPrivateExponent, VERR_INVALID_POINTER); 381 382 return RTBigNumAssign(pPrivateExponent, &pThis->u.RsaPrivate.PrivateExponent); 383 } 384
Note:
See TracChangeset
for help on using the changeset viewer.