Lines Matching refs:key
193 xmlSecKeyPtr key);
254 xmlSecKeyPtr key);
302 + * Internal NSS key slot data
473 + * @hKeyStore: the pointer to key store.
476 + * Create and load key store and certificate database into keys manager
500 + * At present, MS Crypto engine do not provide a way to setup a key store.
503 + /*TODO: binding key store.*/
519 + * Add key store to manager, from now on keys manager destroys the store if
549 + * Set certificate databse to X509 key data store
568 + /*TODO: import the key into keys manager.*/
577 + /*TODO: import the key into keys manager.*/
586 + /*TODO: import the key into keys manager.*/
831 + /* Create a key slot */
884 + * Add key store to manager, from now on keys manager destroys the store if
914 + * Set certificate databse to X509 key data store
957 + xmlSecKeyPtr key ;
985 + key = xmlSecKeyCreate() ;
986 + if( key == NULL ) {
996 + if( xmlSecKeySetValue( key , data ) < 0 ) {
1006 + if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) {
1012 + xmlSecKeyDestroy( key ) ;
1024 + xmlSecKeyPtr key ;
1052 + key = xmlSecKeyCreate() ;
1053 + if( key == NULL ) {
1063 + if( xmlSecKeySetValue( key , data ) < 0 ) {
1073 + if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) {
1079 + xmlSecKeyDestroy( key ) ;
1091 + xmlSecKeyPtr key ;
1119 + key = xmlSecKeyCreate() ;
1120 + if( key == NULL ) {
1130 + if( xmlSecKeySetValue( key , data ) < 0 ) {
1140 + if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) {
1146 + xmlSecKeyDestroy( key ) ;
1191 - * So, if store->findkey is done and the key is not found in the simple
1193 - * If store is called to adopt a key, that key is not written to the NSS
1205 + * NSS key store uses a key list and a slot list as the key repository. NSS slot
1206 + * list is a backup repository for the finding keys. If a key is not found from
1207 + * the key list, the NSS slot list is looked up.
1209 + * Any key in the key list will not save to pkcs11 slot. When a store to called
1210 + * to adopt a key, the key is resident in the key list; While a store to called
1211 + * to set a is resident in the key list; While a store to called to set a slot
1221 + * as add a token to, delete a token from the list, will directly effect the key
1268 + * Internal NSS key store context
1365 + xmlSecKeyPtr key
1402 + if( xmlSecPtrListAdd( context->keyList , key ) < 0 ) {
1458 - * @key: the pointer to key.
1460 - * Adds @key to the @store.
1469 -xmlSecNssKeysStoreAdoptKey(xmlSecKeyStorePtr store, xmlSecKeyPtr key) {
1473 - xmlSecAssert2((key != NULL), -1);
1510 + xmlSecKeyPtr key = NULL ;
1522 + /* Find symmetric key from the slot by name */
1525 + /* Check the key request */
1533 + /* We find a eligible key */
1541 + /* Destroy the sym key list */
1552 + /* Find asymmetric key from the slot by name */
1557 + /* Check the key request */
1558 + length = SECKEY_PublicKeyStrength( curPub->key ) ;
1565 + /* We find a eligible key */
1566 + pubKey = curPub->key ;
1577 + /* Destroy the public key list */
1584 + /* Find asymmetric key from the slot by name */
1589 + /* Check the key request */
1590 + length = PK11_SignatureLen( curPri->key ) ;
1597 + /* We find a eligible key */
1598 + priKey = curPri->key ;
1609 + /* Destroy the private key list */
1613 + /* If we have gotten the key value */
1615 + if( ( key = xmlSecKeyCreate() ) == NULL ) {
1626 + if( xmlSecKeySetValue( key , data ) < 0 ) {
1633 + xmlSecKeyDestroy( key ) ;
1642 + return(key);
1648 + * @name: the desired key name.
1649 + * @keyInfoCtx: the pointer to key info context.
1652 + * the returned key using #xmlSecKeyDestroy method.
1654 + * Returns the pointer to a key or NULL if key is not found or an error occurs.
1663 + xmlSecKeyPtr key = NULL ;
1683 + * Look for key at keyList at first.
1688 + key = ( xmlSecKeyPtr )xmlSecPtrListGetItem( context->keyList , pos ) ;
1689 + if( key != NULL && xmlSecKeyMatch( key , name , &( keyInfoCtx->keyReq ) ) ) {
1690 + return xmlSecKeyDuplicate( key ) ;
1696 + * Find the key from slotList
1708 + key = xmlSecNssKeysStoreFindKeyFromSlot( slot, name, keyInfoCtx ) ;
1709 + if( key == NULL ) {
1712 + return( key ) ;
1719 + * Create a session key if we can not find the key from keyList and slotList
1722 + key = xmlSecKeyGenerate( keyInfoCtx->keyReq.keyId , keyInfoCtx->keyReq.keyBitsSize , x…
1723 + if( key == NULL ) {
1732 + return key ;
1736 + * We have no way to find the key any more.
1752 - return (xmlSecSimpleKeysStoreAdoptKey(*ss, key));
1779 + xmlSecKeyPtr key;
1850 - xmlSecKeyPtr key = NULL;
1866 - key = xmlSecKeyStoreFindKey(*ss, name, keyInfoCtx);
1867 - if (key != NULL) {
1868 - return (key);
1871 - /* Try to find the key in the NSS DB, and construct an xmlSecKey.
1880 - /* what type of key are we looking for?
1895 + key = (xmlSecKeyPtr)xmlSecPtrListGetItem(list, i);
1896 + xmlSecAssert2(key != NULL, -1);
1922 + /* special data key name */
1923 + if(xmlSecKeyGetName(key) != NULL) {
1953 - key = xmlSecKeyCreate();
1954 - if (key == NULL) {
1982 + data = xmlSecKeyGetData(key, dataId);
2036 - ret = xmlSecKeySetValue(key, data);
2052 - ret = xmlSecKeyAdoptData(key, x509Data);
2053 + /* finally write key in the node */
2054 + ret = xmlSecKeyInfoNodeWrite(cur, key, &keyInfoCtx);
2073 - retval = key;
2074 - key = NULL;
2094 - if (key != NULL) {
2095 - xmlSecKeyDestroy(key);
2161 + * key wrap transforms
2177 + xmlSecBufferPtr material ; /* to be encrypted/decrypted key material */
2185 + xmlSecKeyPtr key);
2339 +xmlSecNssKeyWrapSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) {
2347 + xmlSecAssert2(key != NULL, -1);
2358 + xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ;
2360 + keyData = xmlSecKeyGetValue( key ) ;
2363 + xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) ,
2385 + * key wrap transform
2429 + /* read raw key material into context */
2452 + * key wrap transform update
2471 + /* read raw key material and append into context */
2971 + /* read raw key material and append into context */
2990 + /* Now we get all of the key materail */
2991 + /* from now on we will wrap or unwrap the key */
3248 + * The AES-128 key wrapper transform klass.
3250 + * Returns AES-128 key wrapper transform klass.
3260 + * The AES-192 key wrapper transform klass.
3262 + * Returns AES-192 key wrapper transform klass.
3271 + * The AES-256 key wrapper transform klass.
3273 + * Returns AES-256 key wrapper transform klass.
3319 + * The Triple DES key wrapper transform klass.
3321 + * Returns Triple DES key wrapper transform klass.
3385 ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key));
3391 /* we can have only private key or public key */
3496 ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key));
3552 + CK_MECHANISM_TYPE cipher ; /* the symmetic key mechanism */
3553 + PK11SlotInfo* slot ; /* the key resident slot */
3554 + PK11SymKey* symkey ; /* the symmetic key */
3572 + * @data: the pointer to symmetric key data.
3573 + * @symkey: the symmetric key
3575 + * Set the value of symmetric key data.
3811 xmlSecNssSymKeyDataXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
3824 + xmlSecAssert2(key != NULL, -1);
3842 + /* Create a buffer for raw symmetric key value */
3853 + /* Read the raw key value */
3880 + /* Wrap the raw key value SECItem */
3885 + /* Import the raw key into slot temporalily and get the key handler*/
3901 + /* raw key material has been copied into symKey, it isn't used any more */
3904 + /* Adopt the symmetric key into key data */
3930 - return(xmlSecKeyDataBinaryValueXmlRead(id, key, node, keyInfoCtx));
3931 + ret = xmlSecKeySetValue(key, data);
3946 xmlSecNssSymKeyDataXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
3952 - return(xmlSecKeyDataBinaryValueXmlWrite(id, key, node, keyInfoCtx));
3953 + xmlSecAssert2(key != NULL, -1);
3957 + /* Get symmetric key from "key" */
3958 + symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key));
3963 + /* Extract raw key data from symmetric key */
3974 + /* Get raw key data from "symKey" */
3986 + /* Create key data buffer with raw kwy material */
4000 + /* Write raw key material into current xml node */
4019 xmlSecNssSymKeyDataBinRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
4031 + xmlSecAssert2(key != NULL, -1);
4062 + /* Wrap the raw key value SECItem */
4067 + /* Import the raw key into slot temporalily and get the key handler*/
4080 + /* Adopt the symmetric key into key data */
4108 - return(xmlSecKeyDataBinaryValueBinRead(id, key, buf, bufSize, keyInfoCtx));
4109 + ret = xmlSecKeySetValue(key, data);
4124 xmlSecNssSymKeyDataBinWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
4130 + xmlSecAssert2(key != NULL, -1);
4135 + /* Get symmetric key from "key" */
4136 + symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key));
4140 + /* Extract raw key data from symmetric key */
4151 + /* Get raw key data from "symKey" */
4179 - return(xmlSecKeyDataBinaryValueBinWrite(id, key, buf, bufSize, keyInfoCtx));
4206 + "Symmetric key size must be octuple");
4957 xmlSecKeyPtr key,
4970 xmlSecNssKeyDataX509XmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
4982 xmlSecAssert2(key != NULL, -1);
5003 data = xmlSecKeyGetData(key, id);
5005 /* no x509 data in the key */
5479 xmlSecNssKeyDataX509VerifyAndExtractKey(xmlSecKeyDataPtr data, xmlSecKeyPtr key,
5492 xmlSecAssert2(key != NULL, -1);
5504 + * Get Public key from cert, which does not always work for sign
5516 + * I'll search key according to KeyReq.
5563 /* verify that the key matches our expectations */