Exemple #1
0
 public BiKeyPair HandleKey(HandleKeyParams spec) {
     if (spec.Key == null) {
         spec.Key = GetDefaultPrivateKeyPath(spec.KeyPath, spec.Prefix,
             spec.Directory);
     }
     var signKey = new BiKeyPair(spec.Key);
     if (!signKey.PrivateFile.Exists)
         BiKeyPair.CreateKey(Path.Combine(signKey.Location, signKey.Name).ToAbsoluteFilePath(), _pboTools);
     if (spec.CopyKey)
         CopyKeyToKeysSubfolder(signKey, spec.Directory);
     return signKey;
 }
Exemple #2
0
 static void CopyKeyToKeysSubfolder(BiKeyPair key, IAbsoluteDirectoryPath destination) {
     var keysFolder = destination.GetChildDirectoryWithName("keys");
     keysFolder.MakeSurePathExists();
     Tools.FileUtil.Ops.CopyWithRetry(key.PublicFile,
         keysFolder.GetChildFileWithName(key.PublicFile.FileName));
 }
 public void SignFolder(IAbsoluteDirectoryPath folder, BiKeyPair key) {
     _biSigner.SignFolder(folder, key.PrivateFile);
 }
 public void SignAllInFolder(IAbsoluteDirectoryPath folder, BiKeyPair key) {
     SignFolderRecursively(folder, key.PrivateFile);
 }
 public void SignFile(IAbsoluteFilePath file, BiKeyPair key) {
     _biSigner.SignFile(file, key.PrivateFile);
 }