コード例 #1
0
ファイル: stream.cpp プロジェクト: AlanDeSmet/htcondor
void 
Stream::set_crypto_mode(bool enabled)
{
	if (canEncrypt() && enabled) {
		crypto_mode_ = true;
	} else {
		if (enabled) {
			dprintf ( D_SECURITY, "NOT enabling crypto - there was no key exchanged.\n");
		}
		crypto_mode_ = false;
	}
}
コード例 #2
0
ファイル: stream.cpp プロジェクト: AlanDeSmet/htcondor
bool
Stream::prepare_crypto_for_secret_is_noop()
{
	CondorVersionInfo const *peer_ver = get_peer_version();
	if( !peer_ver || peer_ver->built_since_version(7,1,3) ) {
		if( !get_encryption() ) {
			if( canEncrypt() ) {
					// do turn on encryption before sending secret
				return false;
			}
		}
	}
	return true;
}
コード例 #3
0
ファイル: ExportKey.cpp プロジェクト: jbfavre/xca
ExportKey::ExportKey(QWidget *parent, QString fname, bool onlypub)
    :ExportDialog(parent, fname)
{
    onlyPub = onlypub;

    QStringList sl;
    sl << "PEM" << "DER";
    exportFormat->addItems(sl);
    suffixes << "pem" << "der";

    filter = tr("Private keys ( *.pem *.der *.pk8 );;All files ( * )");

    formatLabel->setText(tr(
                             "DER is a binary format of the key without encryption\n"
                             "PEM is a base64 encoded key with optional encryption\n"
                             "PKCS#8 is an encrypted official Key-exchange format"));

    filenameLabel->setText(tr(
                               "Please enter the filename for the key."));

    Ui::ExportKey::setupUi(extraFrame);
    if (onlyPub) {
        label->setText(tr("Public key export"));
        extraFrame->hide();
    } else {
        label->setText(tr("Key export"));
        exportPrivate->setChecked(true);
        connect(exportPkcs8, SIGNAL(stateChanged(int)),
                this, SLOT(canEncrypt()));
        connect(exportPrivate, SIGNAL(stateChanged(int)),
                this, SLOT(canEncrypt()));
        connect(exportFormat, SIGNAL(currentIndexChanged(int)),
                this, SLOT(canEncrypt()));
        canEncrypt();
    }
}