Skip to content

Nie mogę dodać certyfikatu do programu #95

@juhacz

Description

@juhacz

Cześć

Zainstalowałem na nowo program, wcześniej nim się bawiłem, po raz pierwszy próbuję dodać do programu certyfikat i mam błąd.
Wskazuję plik certyfikatu, plik klucza, wklejam hasło (20 znaków) i mam błąd

System.Security.Cryptography.CryptographicException: The EncryptedPrivateKeyInfo structure was decoded but was not successfully interpreted, the password may be incorrect.
 ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
   at System.Security.Cryptography.SymmetricPadding.GetPaddingLength(ReadOnlySpan`1 block, PaddingMode paddingMode, Int32 blockSize)
   at System.Security.Cryptography.UniversalCryptoDecryptor.UncheckedTransformFinalBlock(ReadOnlySpan`1 inputBuffer, Span`1 outputBuffer)
   at System.Security.Cryptography.UniversalCryptoDecryptor.UncheckedTransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
   at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(SymmetricAlgorithm cipher, ReadOnlySpan`1 key, ReadOnlySpan`1 iv, ReadOnlySpan`1 encryptedData, Span`1 destination)
   at System.Security.Cryptography.PasswordBasedEncryption.Pbes2Decrypt(Nullable`1 algorithmParameters, ReadOnlySpan`1 password, ReadOnlySpan`1 encryptedData, Span`1 destination)
   at System.Security.Cryptography.PasswordBasedEncryption.Pbes2Decrypt(Nullable`1 algorithmParameters, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
   at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
   at System.Security.Cryptography.KeyFormatHelper.DecryptPkcs8(ReadOnlySpan`1 inputPassword, ReadOnlySpan`1 inputPasswordBytes, ReadOnlyMemory`1 source, Int32& bytesRead)
   --- End of inner exception stack trace ---
   at System.Security.Cryptography.KeyFormatHelper.DecryptPkcs8(ReadOnlySpan`1 inputPassword, ReadOnlySpan`1 inputPasswordBytes, ReadOnlyMemory`1 source, Int32& bytesRead)
   at System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo.DecryptAndDecode(ReadOnlySpan`1 password, ReadOnlyMemory`1 source, Int32& bytesRead)
   at KSeF.Client.Extensions.X509CertificateLoaderExtensions.MergeWithPemKeyNoProfileForEcdsa(X509Certificate2 publicCert, String privateKeyPem, String password)
   at KSeF.Client.Extensions.X509CertificateLoaderExtensions.MergeWithPemKey(X509Certificate2 publicCert, String privateKeyPem, String password)
   at ProFak.UI.Kontrahenci.ImportCertyfikatuKSeFEdytor.buttonZapisz_Click(Object sender, EventArgs e)

Oczywiście hasło jest prawidłowe, wygenerowane w Bitwarden, wklejam je nie wpisuję, być może problemem jest, że zawiera znaki specjalne jak #&$. Najnowsza wersja z dziś.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions