AbstractFileBrowser.st
changeset 8645 00e4d07c6d6d
parent 8641 702359d52e63
child 8646 8046120212f6
equal deleted inserted replaced
8644:bf28461ddc2b 8645:00e4d07c6d6d
  1586 
  1586 
  1587     ^ 
  1587     ^ 
  1588      #(Menu
  1588      #(Menu
  1589         (
  1589         (
  1590          (MenuItem
  1590          (MenuItem
  1591             label: 'Generate Signature'
  1591             label: 'Generate Signed File'
  1592             itemValue: generateSignaturesForSelectedFiles
  1592             itemValue: generateSignaturesForSelectedFiles
  1593             translateLabel: true
  1593             translateLabel: true
  1594             isVisible: canGenerateSignatureFiles
  1594             isVisible: canGenerateSignatureFiles
  1595           )
  1595           )
  1596          (MenuItem
  1596          (MenuItem
  5831 
  5831 
  5832     "Modified: / 04-12-2006 / 13:14:48 / cg"
  5832     "Modified: / 04-12-2006 / 13:14:48 / cg"
  5833 !
  5833 !
  5834 
  5834 
  5835 generateSignaturesForSelectedFiles
  5835 generateSignaturesForSelectedFiles
  5836     "generate .sig files"
  5836     "generate signed pkcs7 files from the contents of the selected files"
  5837 
  5837 
  5838     self withActivityIndicationDo:[
  5838     self withActivityIndicationDo:[
  5839         self currentSelectedFiles do:[:fn |
  5839         self currentSelectedFiles do:[:fn |
  5840             |data hash signature signatureFile|
  5840             |pkcs7SignedData signatureFilename|
  5841 
  5841 
  5842             self notify:'Generating signature file for ',(fn baseName),'...'.
  5842             self notify:'Generating signature file for ', (fn baseName), '...'.
  5843 
  5843 
  5844             data := fn contentsAsString.
  5844             pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile.
  5845             hash := SHA1Stream hashValueOf:data.
  5845             signatureFilename := fn addSuffix:'sig'.
  5846 
  5846             signatureFilename contents:pkcs7SignedData.
  5847             signature := Expecco::KeyFileGenerator new signExpeccoCode:hash.
       
  5848 
       
  5849             signatureFile := fn withSuffix:'sig'.
       
  5850             signatureFile contents:signature.
       
  5851         ].
  5847         ].
  5852         self notify:nil.
  5848         self notify:nil.
  5853     ]
  5849     ]
  5854 !
  5850 !
  5855 
  5851 
  6747 
  6743 
  6748     ^ self canDoTerminal and:[OperatingSystem isUNIXlike]
  6744     ^ self canDoTerminal and:[OperatingSystem isUNIXlike]
  6749 !
  6745 !
  6750 
  6746 
  6751 canGenerateSignatureFiles
  6747 canGenerateSignatureFiles
  6752     |sel|
  6748     "we need the both the KeyFileGenerator (for the secret expecco key) and the KeyFile"
  6753 
  6749 
  6754     Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ].
  6750     Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ].
  6755     Expecco::KeyFile isNil ifTrue:[ ^ false ].
  6751     Expecco::KeyFile isNil ifTrue:[ ^ false ].
  6756 
  6752 
  6757     sel := self currentSelectedFiles.
  6753     ^ self currentSelectedFiles notEmptyOrNil
  6758     sel isEmptyOrNil ifTrue:[ ^ false ].
       
  6759     ^ true.
       
  6760 !
  6754 !
  6761 
  6755 
  6762 canReadAbbrevFile
  6756 canReadAbbrevFile
  6763 
  6757 
  6764     |currentDirectory|
  6758     |currentDirectory|
  7797 ! !
  7791 ! !
  7798 
  7792 
  7799 !AbstractFileBrowser class methodsFor:'documentation'!
  7793 !AbstractFileBrowser class methodsFor:'documentation'!
  7800 
  7794 
  7801 version
  7795 version
  7802     ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.408 2009-06-05 13:21:07 cg Exp $'
  7796     ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.409 2009-06-08 16:40:57 stefan Exp $'
  7803 ! !
  7797 ! !