public-key

openssl ? Join a public and a private key

感情迁移 提交于 2020-06-29 08:06:30
问题 Basicly, I have a private PEM key and a public certificate PEM key. They work when I use them both (but don't work if I only use one of them). I use and this works: wget --no-check-certificate --private-key=dev-private.pem --certificate=dev.pem https://???.???.???.??? (This is self-signed certificate signed by java keytool. I have acces to this keystore.) I also produce a jks and it's work great in browser. The problem is one of my application I neeed to use a certificate and he only support

Bouncy Castle - how to get Public Key Info from JceOpenSSLPKCS8DecryptorProviderBuilder

江枫思渺然 提交于 2020-06-01 08:03:40
问题 I have the following code to extract Private Key PEMParser parser = new PEMParser(new InputStreamReader(new ByteArrayInputStream(decoded))); Object object = parser.readObject(); PEMDecryptorProvider provider = new JcePEMDecryptorProviderBuilder() .build(props.getProperty(KeytoolFlags.KEYPASS.name()).toCharArray()); JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(BouncyCastleProvider.PROVIDER_NAME); if (object instanceof PEMEncryptedKeyPair) { KeyPair pair = converter

Bouncy Castle - how to get Public Key Info from JceOpenSSLPKCS8DecryptorProviderBuilder

隐身守侯 提交于 2020-06-01 08:02:17
问题 I have the following code to extract Private Key PEMParser parser = new PEMParser(new InputStreamReader(new ByteArrayInputStream(decoded))); Object object = parser.readObject(); PEMDecryptorProvider provider = new JcePEMDecryptorProviderBuilder() .build(props.getProperty(KeytoolFlags.KEYPASS.name()).toCharArray()); JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(BouncyCastleProvider.PROVIDER_NAME); if (object instanceof PEMEncryptedKeyPair) { KeyPair pair = converter

How can I encrypt with a RSA private key in python?

荒凉一梦 提交于 2020-05-25 07:49:44
问题 Is it possible to encrypt a message with a private key in python using pycryptodome or any other library? I know that you are not supposed to encrypt with the private key and decrypt with the public key, but my purpose is to encrypt with the private one so the receiver could be sure that the message was send by the real author. More than secure encryption I'm looking for some kind of obfuscation. I want to do an app where the message is public but it can only be seen if you have the public

Trouble loading RSA public key from file

扶醉桌前 提交于 2020-05-16 03:17:26
问题 I've been using openssl library in my C++ project recently, and I'm facing an issue that i can't fix by myself. I'm actually trying to load an RSA public key stored in a file and encrypt 64 bytes. My code works when it uses a public key generated using the function RSA_generate_key, but when i'm using my own public key, it won't work anymore for some reason. I've suspected key format from pkcs1 pkcs8, tried both PEM_read_RSAPublicKey and PEM_read_RSA_PUBKEY, still not working for some reason.

openSSL: difference between PEM_write_RSAPublicKey and PEM_write_RSA_PUBKEY

两盒软妹~` 提交于 2020-04-10 11:56:05
问题 In the openssl library I can see two methods to write a public Key to a file: int PEM_write_RSAPublicKey(FILE *fp, RSA *x); int PEM_write_RSA_PUBKEY(FILE *fp, RSA *x); In the documentation i can see: The RSAPublicKey functions process an RSA public key using an RSA structure. The public key is encoded using a PKCS#1 RSAPublicKey structure. The RSA_PUBKEY functions also process an RSA public key using an RSA structure. However the public key is encoded using a SubjectPublicKeyInfo structure

WebAuthn - byte length of the “credential public key”

↘锁芯ラ 提交于 2020-01-25 02:49:07
问题 In WebAuthn, the authenticator data contains the variable length attested credential data followed by the extensions , if any: The attested credential data is made variable because of the credential public key field which is a CBOR map. In case there are extensions, how to know in advance the byte length of this field, so that I can pass this field truncated without the extensions to a CBOR library? The CBOR library I am using doesn't seem to handle extra bytes, and I don't know CBOR enough

asymmetric key creation over network

家住魔仙堡 提交于 2020-01-14 09:26:26
问题 I'm attempting to add an assembly to a database in SQL2008 using an asymmetric key. We're adding the assembly using a hex string (adding assemblies to servers through sql queries only) USE [master] GO IF NOT EXISTS (SELECT * from sys.asymmetric_keys where name = 'ManagedAsymmetricKey') BEGIN CREATE ASYMMETRIC KEY ManagedAsymmetricKey FROM FILE = 'C:\Managed.dll' CREATE LOGIN CLRLogin FROM ASYMMETRIC KEY ManagedAsymmetricKey GRANT UNSAFE ASSEMBLY TO CLRLogin END GO USE [$dbName] GO CREATE

How can I import an RSA public key from either XML or modulus/exponent in native code for use with Windows CAPI's CryptVerifySignature?

北慕城南 提交于 2020-01-14 05:29:06
问题 In C#, I am able to validate a hash against a public key in either of the following ways: // Import from raw modulus and exponent using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) { RSAParameters rsaKeyInfo = new RSAParameters {Modulus = modulus, Exponent = exponent}; rsa.ImportParameters(rsaKeyInfo); return rsa.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA512"), signature); } // Import from XML using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) { rsa

How can I import an RSA public key from either XML or modulus/exponent in native code for use with Windows CAPI's CryptVerifySignature?

让人想犯罪 __ 提交于 2020-01-14 05:29:06
问题 In C#, I am able to validate a hash against a public key in either of the following ways: // Import from raw modulus and exponent using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) { RSAParameters rsaKeyInfo = new RSAParameters {Modulus = modulus, Exponent = exponent}; rsa.ImportParameters(rsaKeyInfo); return rsa.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA512"), signature); } // Import from XML using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) { rsa