示例#1
0
 public string WithVolumeInfo(ChangeVolumeAttributesParams volumeParams)
 {
     return($"{WithTokenId(Resources.VolumeAccessModeChangeSuccess)} : " +
            $"{volumeParams.VolumeId} " +
            $"{_volumeAttributesStore.GetAccessModeDescription(volumeParams.AccessMode)} " +
            $"{_volumeAttributesStore.GetPermanentStateDescription(volumeParams.Permanent)}");
 }
示例#2
0
 public static void Change(IRutokenSlot slot,
                           ChangeVolumeAttributesParams volumeAttributes)
 {
     try
     {
         slot.ChangeVolumeAttributes(
             volumeAttributes.VolumeOwner,
             volumeAttributes.OwnerPin,
             (uint)volumeAttributes.VolumeId,
             volumeAttributes.AccessMode,
             volumeAttributes.Permanent);
     }
     catch (Pkcs11Exception ex) when(ex.RV == CKR.CKR_PIN_INCORRECT)
     {
         throw new CKRException(ex.RV, Resources.IncorrectVolumeOwnerPin);
     }
 }