/[winpt]/trunk/MyGPGME/key.c
ViewVC logotype

Diff of /trunk/MyGPGME/key.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 11 by twoaday, Thu Apr 14 12:55:57 2005 UTC
# Line 751  gpgme_key_expand_attr( int what, unsigne Line 751  gpgme_key_expand_attr( int what, unsigne
751          case 16:          case 16:
752          case 20: return "ELG";          case 20: return "ELG";
753          case 17: return "DSA";          case 17: return "DSA";
         default: return "???";  
754          }                }      
755          break;          return "???";
756                    
757      case GPGME_ATTR_ALGO_SHORT:      case GPGME_ATTR_ALGO_SHORT:
758          switch( attr ) {          switch( attr ) {
# Line 763  gpgme_key_expand_attr( int what, unsigne Line 762  gpgme_key_expand_attr( int what, unsigne
762          case 2:          case 2:
763          case 3: return "R";          case 3: return "R";
764          case 20: return "G";          case 20: return "G";
         default: return "?";  
765          }          }
766          break;          return "?";
767                    
768      case GPGME_ATTR_VALIDITY:      case GPGME_ATTR_VALIDITY:
769          switch( attr ) {                          switch( attr ) {                
# Line 784  gpgme_key_expand_attr( int what, unsigne Line 782  gpgme_key_expand_attr( int what, unsigne
782          case GPGME_VALIDITY_FULL:      return "Full";          case GPGME_VALIDITY_FULL:      return "Full";
783          case 'u':          case 'u':
784          case GPGME_VALIDITY_ULTIMATE:  return "Ultimate";          case GPGME_VALIDITY_ULTIMATE:  return "Ultimate";
         default:                       return "???";          
785          }          }
786          break;          return "???";
787                    
788      case GPGME_ATTR_CREATED:          case GPGME_ATTR_CREATED:    
789          iso_date = localtime((long*) &attr);          iso_date = localtime((long*) &attr);
# Line 848  gpgme_key_get_cability( gpgme_key_t key, Line 845  gpgme_key_get_cability( gpgme_key_t key,
845  } /* gpgme_key_get_cability */  } /* gpgme_key_get_cability */
846    
847  int  int
848  gpgme_key_count_items( gpgme_key_t key, int what )  gpgme_key_count_items (gpgme_key_t key, int what)
849  {  {
850      union {      union {
851          struct user_id_s *u;          struct user_id_s *u;
# Line 901  _gpgme_key_new_fromkeyid (const char * k Line 898  _gpgme_key_new_fromkeyid (const char * k
898    
899    
900  int  int
901  gpgme_key_cability_from_algo( gpgme_pk_cipher_t algo )  gpgme_key_cability_from_algo (gpgme_pk_cipher_t algo)
902  {  {
903      switch( algo ) {      switch( algo ) {
904      case GPGME_PK_DSA:      case GPGME_PK_DSA:
# Line 915  gpgme_key_cability_from_algo( gpgme_pk_c Line 912  gpgme_key_cability_from_algo( gpgme_pk_c
912      case GPGME_PK_RSA_E:      case GPGME_PK_RSA_E:
913      case GPGME_PK_ELG_E:      case GPGME_PK_ELG_E:
914          return GPGME_KEY_CANENCR;          return GPGME_KEY_CANENCR;
   
     default:  
         return 0;  
915      }      }
916    
917      return 0;      return 0;
918  } /* gpgme_key_cability_from_algo */  } /* gpgme_key_cability_from_algo */
919    
920    
921    int
922    gpgme_key_append (gpgme_key_t dst, gpgme_key_t src, int idx)
923    {
924        struct subkey_s *s, *key;
925    
926        for (s = &src->keys; idx; idx--, s = s->next)
927            ;
928    
929        key = _gpgme_key_add_subkey (dst);
930        key->expires = s->expires;
931        key->flags = s->flags;
932        key->key_algo = s->key_algo;
933        key->key_len = s->key_len;
934        key->timestamp = s->timestamp;
935        key->fingerprint = strdup (s->fingerprint);
936        strcpy (key->keyid, s->keyid);
937        
938        return 0;
939    }

Legend:
Removed from v.2  
changed lines
  Added in v.11

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26