Enigma: Display all usage flags of the subkey

pull/301/head
Aleksander Machniak 9 years ago
parent a03233ceba
commit c852426bd4

@ -423,14 +423,6 @@ class enigma_driver_gnupg extends enigma_driver
$ekey->name = trim($ekey->users[0]->name . ' <' . $ekey->users[0]->email . '>');
foreach ($key->getSubKeys() as $idx => $subkey) {
$usage = 0;
if ($subkey->canSign()) {
$usage += enigma_key::CAN_SIGN;
}
if ($subkey->canEncrypt()) {
$usage += enigma_key::CAN_ENCRYPT;
}
$skey = new enigma_subkey();
$skey->id = $subkey->getId();
$skey->revoked = $subkey->isRevoked();
@ -440,7 +432,7 @@ class enigma_driver_gnupg extends enigma_driver
$skey->has_private = $subkey->hasPrivate();
$skey->algorithm = $subkey->getAlgorithm();
$skey->length = $subkey->getLength();
$skey->usage = $usage;
$skey->usage = $subkey->usage();
$ekey->subkeys[$idx] = $skey;
};

@ -26,10 +26,10 @@ class enigma_key
const TYPE_KEYPAIR = 1;
const TYPE_PUBLIC = 2;
const CAN_SIGN = 1;
const CAN_ENCRYPT = 2;
const CAN_CERTIFY = 4;
const CAN_AUTH = 8;
const CAN_ENCRYPT = 1;
const CAN_SIGN = 2;
const CAN_CERTIFY = 4;
const CAN_AUTHENTICATE = 8;
/**

@ -398,10 +398,10 @@ class enigma_ui
$now = time();
$date_format = $this->rc->config->get('date_format', 'Y-m-d');
$usage_map = array(
enigma_key::CAN_ENCRYPT => $this->enigma->gettext('typeencrypt'),
enigma_key::CAN_SIGN => $this->enigma->gettext('typesign'),
enigma_key::CAN_CERTIFY => $this->enigma->gettext('typecert'),
enigma_key::CAN_AUTH => $this->enigma->gettext('typeauth'),
enigma_key::CAN_ENCRYPT => $this->enigma->gettext('typeencrypt'),
enigma_key::CAN_SIGN => $this->enigma->gettext('typesign'),
enigma_key::CAN_CERTIFY => $this->enigma->gettext('typecert'),
enigma_key::CAN_AUTHENTICATE => $this->enigma->gettext('typeauth'),
);
foreach ($this->data->subkeys as $subkey) {

Loading…
Cancel
Save