Beispiel #1
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));
        }
Beispiel #2
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);
        }
Beispiel #3
0
 public void SignAllInFolder(IAbsoluteDirectoryPath folder, BiKeyPair key)
 {
     SignFolderRecursively(folder, key.PrivateFile);
 }
Beispiel #4
0
 public void SignFolder(IAbsoluteDirectoryPath folder, BiKeyPair key)
 {
     _biSigner.SignFolder(folder, key.PrivateFile);
 }
Beispiel #5
0
 public void SignFile(IAbsoluteFilePath file, BiKeyPair key)
 {
     _biSigner.SignFile(file, key.PrivateFile);
 }