From ac759dc0debfdf81d4c5c2c959b774be5888bf6e Mon Sep 17 00:00:00 2001 From: Claudia Murialdo Date: Tue, 8 Jun 2021 12:54:52 -0300 Subject: [PATCH 1/5] Upload Tests. Migrate csproj format. --- .gitignore | 7 +- SecurityAPIParent.sln | 28 +- .../obj/project.nuget.cache | 70 -- dotnet/dotnetframework/Directory.Build.props | 8 + .../GeneXusCryptography.csproj | 86 +- .../Properties/AssemblyInfo.cs | 29 - .../GeneXusFtps/GeneXusFtps.csproj | 66 +- .../GeneXusFtps/Properties/AssemblyInfo.cs | 29 - .../GeneXusJWT/GeneXusJWT.csproj | 85 +- .../GeneXusJWT/Properties/AssemblyInfo.cs | 29 - .../GeneXusSftp/GeneXusSftp.csproj | 62 +- .../GeneXusSftp/Properties/AssemblyInfo.cs | 29 - .../GeneXusXmlSignature.csproj | 79 +- .../Properties/AssemblyInfo.cs | 32 - .../Config/AvailableEncoding.cs | 33 +- .../Properties/AssemblyInfo.cs | 30 - .../SecurityAPICommons.csproj | 82 +- .../Utils/ExtensionsWhiteList.cs | 22 - .../SecurityAPICommons/Utils/SecurityUtils.cs | 14 +- .../SecurityAPITestNetCore.csproj | 740 ++++++++++++++++++ .../Asymmetric/TestAsymmetricDomainSpaces.cs | 48 ++ .../Asymmetric/TestECDSASigning.cs | 140 ++++ .../Asymmetric/TestRSAEncryption.cs | 330 ++++++++ .../Cryptography/Asymmetric/TestRSASigning.cs | 295 +++++++ .../Cryptography/Checksum/TestChecksum.cs | 136 ++++ .../Cryptography/Hash/TestHashDomainSpaces.cs | 31 + .../Cryptography/Hash/TestHashing.cs | 88 +++ .../Cryptography/Mac/TestCmac.cs | 650 +++++++++++++++ .../Cryptography/Mac/TestHmac.cs | 114 +++ .../TestPasswordDerivation.cs | 127 +++ .../Symmetric/TestBlockEncryption.cs | 660 ++++++++++++++++ .../Symmetric/TestStreamEncryption.cs | 156 ++++ .../Symmetric/TestSymmetricDomainSpaces.cs | 58 ++ .../SecurityAPITest/Ftps/TestFtps.cs | 138 ++++ .../Ftps/TestFtpsDomainSpaces.cs | 82 ++ .../Jwt/Asymmetric/TestAsymmetricJwt.cs | 279 +++++++ .../Jwt/Asymmetric/TestCreateWithoutCert.cs | 61 ++ .../Jwt/Asymmetric/TestECDSACurvesPrimeJwt.cs | 197 +++++ .../Jwt/Asymmetric/TestECDSACurvesSecpJwt.cs | 278 +++++++ .../Jwt/Asymmetric/TestECDSACurvesSectJwt.cs | 347 ++++++++ .../Jwt/Features/TestJwtDiverseDataTypes.cs | 70 ++ .../Jwt/Features/TestJwtHeaderParameters.cs | 98 +++ .../Jwt/Features/TestJwtNestedClaims.cs | 97 +++ .../Jwt/Features/TestJwtRevocationList.cs | 67 ++ .../Features/TestJwtVerifyJustSignature.cs | 96 +++ .../Jwt/Other/TestIssue81664.cs | 68 ++ .../Jwt/Other/TestIssue83649.cs | 56 ++ .../Jwt/Other/TestIssue84142.cs | 55 ++ .../Jwt/Other/TestIssue84859.cs | 50 ++ .../Jwt/Other/TestIssue86867.cs | 65 ++ .../Jwt/Other/TestJwtDomainSpaces.cs | 58 ++ .../Jwt/Other/TestJwtOtherFunctions.cs | 92 +++ .../Jwt/Symmetric/TestSymmetricJwt.cs | 69 ++ .../Properties/AssemblyInfo.cs | 10 + .../commons/SecurityAPITestObject.cs | 42 + .../SecurityAPICommons/encoders/TestBase64.cs | 52 ++ .../SecurityAPICommons/encoders/TestHexa.cs | 36 + .../keys/TestBase64PrivateKey.cs | 39 + .../keys/TestBase64PublicKey.cs | 46 ++ .../SecurityAPITest/SecurityAPITest.csproj | 411 ++++++++++ .../SecurityAPITest/Sftp/TestSftp.cs | 125 +++ .../SecurityAPITest/Temp/bookSample.xml | 31 + .../SecurityAPITest/Temp/ftps/back/dummy.txt | 0 .../SecurityAPITest/Temp/ftps/ftpstest.txt | 0 .../Temp/outputTestFilesC/dummy.txt | 0 .../Temp/outputTestFilesJ/dummy.txt | 0 .../Temp/sftptest/back/dummy.txt | 1 + .../Temp/sftptest/key/dummy.txt | 0 .../Temp/sftptest/sftptest1.txt | 2 + .../SecurityAPITest/Temp/tosign.xml | 6 + .../SecurityAPITest/Temp/xmlID.xml | 15 + .../SecurityAPITest/Temp/xmlIDSchema.xsd | 25 + .../DSig/TestBase64Certificate.cs | 70 ++ .../XmlSignature/DSig/TestFindID.cs | 47 ++ .../XmlSignature/DSig/TestRSASigning.cs | 463 +++++++++++ .../DSig/TestXmlSignatureDomainSpaces.cs | 58 ++ .../dummycerts/ECDSA_sha1/sha1_cert.crt | Bin 0 -> 691 bytes .../dummycerts/ECDSA_sha1/sha1_cert.p12 | Bin 0 -> 1258 bytes .../dummycerts/ECDSA_sha1/sha1_cert.pem | 17 + .../dummycerts/ECDSA_sha1/sha1_key.pem | 6 + .../dummycerts/ECDSA_sha256/sha256_cert.crt | Bin 0 -> 694 bytes .../dummycerts/ECDSA_sha256/sha256_cert.p12 | Bin 0 -> 1258 bytes .../dummycerts/ECDSA_sha256/sha256_cert.pem | 17 + .../dummycerts/ECDSA_sha256/sha256_key.pem | 6 + .../dummycerts/JWT_ECDSA/prime192v1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/prime192v1/key.pem | 5 + .../dummycerts/JWT_ECDSA/prime192v2/cert.pem | 15 + .../dummycerts/JWT_ECDSA/prime192v2/key.pem | 5 + .../dummycerts/JWT_ECDSA/prime192v3/cert.pem | 15 + .../dummycerts/JWT_ECDSA/prime192v3/key.pem | 5 + .../dummycerts/JWT_ECDSA/prime239v1/cert.pem | 16 + .../dummycerts/JWT_ECDSA/prime239v1/key.pem | 5 + .../dummycerts/JWT_ECDSA/prime239v2/cert.pem | 15 + .../dummycerts/JWT_ECDSA/prime239v2/key.pem | 5 + .../dummycerts/JWT_ECDSA/prime239v3/cert.pem | 15 + .../dummycerts/JWT_ECDSA/prime239v3/key.pem | 5 + .../dummycerts/JWT_ECDSA/prime256v1/cert.pem | 16 + .../dummycerts/JWT_ECDSA/prime256v1/key.pem | 5 + .../dummycerts/JWT_ECDSA/prime_test/cert.pem | 16 + .../JWT_ECDSA/prime_test/cert_sha256.pem | 16 + .../JWT_ECDSA/prime_test/cert_sha384.pem | 16 + .../JWT_ECDSA/prime_test/cert_sha512.pem | 16 + .../dummycerts/JWT_ECDSA/prime_test/key.pem | 5 + .../dummycerts/JWT_ECDSA/secp112r1/cert.pem | 14 + .../dummycerts/JWT_ECDSA/secp112r1/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp112r2/cert.pem | 14 + .../dummycerts/JWT_ECDSA/secp112r2/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp128r1/cert.pem | 14 + .../dummycerts/JWT_ECDSA/secp128r1/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp128r2/cert.pem | 14 + .../dummycerts/JWT_ECDSA/secp128r2/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp160k1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/secp160k1/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp160r1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/secp160r1/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp160r2/cert.pem | 15 + .../dummycerts/JWT_ECDSA/secp160r2/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp192k1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/secp192k1/key.pem | 4 + .../dummycerts/JWT_ECDSA/secp224k1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/secp224k1/key.pem | 5 + .../dummycerts/JWT_ECDSA/secp224r1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/secp224r1/key.pem | 5 + .../dummycerts/JWT_ECDSA/secp256k1/cert.pem | 16 + .../dummycerts/JWT_ECDSA/secp256k1/key.pem | 5 + .../dummycerts/JWT_ECDSA/secp384r1/cert.pem | 17 + .../dummycerts/JWT_ECDSA/secp384r1/key.pem | 6 + .../dummycerts/JWT_ECDSA/secp521r1/cert.pem | 19 + .../dummycerts/JWT_ECDSA/secp521r1/key.pem | 7 + .../dummycerts/JWT_ECDSA/sect113r1/cert.pem | 14 + .../dummycerts/JWT_ECDSA/sect113r1/key.pem | 4 + .../dummycerts/JWT_ECDSA/sect113r2/cert.pem | 14 + .../dummycerts/JWT_ECDSA/sect113r2/key.pem | 4 + .../dummycerts/JWT_ECDSA/sect131r1/cert.pem | 14 + .../dummycerts/JWT_ECDSA/sect131r1/key.pem | 4 + .../dummycerts/JWT_ECDSA/sect131r2/cert.pem | 14 + .../dummycerts/JWT_ECDSA/sect131r2/key.pem | 4 + .../dummycerts/JWT_ECDSA/sect163k1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect163k1/key.pem | 4 + .../dummycerts/JWT_ECDSA/sect163r1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect163r1/key.pem | 4 + .../dummycerts/JWT_ECDSA/sect163r2/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect163r2/key.pem | 4 + .../dummycerts/JWT_ECDSA/sect193r1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect193r1/key.pem | 5 + .../dummycerts/JWT_ECDSA/sect193r2/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect193r2/key.pem | 5 + .../dummycerts/JWT_ECDSA/sect233k1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect233k1/key.pem | 5 + .../dummycerts/JWT_ECDSA/sect233r1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect233r1/key.pem | 5 + .../dummycerts/JWT_ECDSA/sect239k1/cert.pem | 15 + .../dummycerts/JWT_ECDSA/sect239k1/key.pem | 5 + .../dummycerts/JWT_ECDSA/sect283k1/cert.pem | 16 + .../dummycerts/JWT_ECDSA/sect283k1/key.pem | 5 + .../dummycerts/JWT_ECDSA/sect283r1/cert.pem | 16 + .../dummycerts/JWT_ECDSA/sect283r1/key.pem | 5 + .../dummycerts/JWT_ECDSA/sect409k1/cert.pem | 17 + .../dummycerts/JWT_ECDSA/sect409k1/key.pem | 6 + .../dummycerts/JWT_ECDSA/sect409r1/cert.pem | 17 + .../dummycerts/JWT_ECDSA/sect409r1/key.pem | 6 + .../dummycerts/JWT_ECDSA/sect571k1/cert.pem | 19 + .../dummycerts/JWT_ECDSA/sect571k1/key.pem | 8 + .../dummycerts/JWT_ECDSA/sect571r1/cert.pem | 19 + .../dummycerts/JWT_ECDSA/sect571r1/key.pem | 8 + .../dummycerts/RSA_sha1_1024/sha1_cert.crt | Bin 0 -> 768 bytes .../dummycerts/RSA_sha1_1024/sha1_cert.p12 | Bin 0 -> 1789 bytes .../dummycerts/RSA_sha1_1024/sha1_cert.pem | 18 + .../dummycerts/RSA_sha1_1024/sha1_cert.pkcs12 | Bin 0 -> 1789 bytes .../dummycerts/RSA_sha1_1024/sha1_key.pem | 17 + .../dummycerts/RSA_sha1_1024/sha1d_key.key | 15 + .../dummycerts/RSA_sha1_1024/sha1d_key.pem | 15 + .../dummycerts/RSA_sha1_1024/sha1e_cert.p12 | Bin 0 -> 1789 bytes .../RSA_sha256_1024/sha256_cert.crt | Bin 0 -> 768 bytes .../RSA_sha256_1024/sha256_cert.p12 | Bin 0 -> 1789 bytes .../RSA_sha256_1024/sha256_cert.pem | 18 + .../dummycerts/RSA_sha256_1024/sha256_key.pem | 17 + .../RSA_sha256_1024/sha256d_key.pem | 15 + .../RSA_sha256_1024/sha256e_cert.p12 | Bin 0 -> 1789 bytes .../RSA_sha256_2048/sha256_cert.crt | Bin 0 -> 1029 bytes .../RSA_sha256_2048/sha256_cert.p12 | Bin 0 -> 2629 bytes .../RSA_sha256_2048/sha256_cert.pem | 24 + .../dummycerts/RSA_sha256_2048/sha256_key.pem | 30 + .../RSA_sha256_2048/sha256d_key.pem | 27 + .../RSA_sha256_2048/sha256e_cert.p12 | Bin 0 -> 2629 bytes .../RSA_sha512_2048/sha512_cert.crt | Bin 0 -> 1027 bytes .../RSA_sha512_2048/sha512_cert.p12 | Bin 0 -> 2629 bytes .../RSA_sha512_2048/sha512_cert.pem | 24 + .../dummycerts/RSA_sha512_2048/sha512_key.pem | 30 + .../RSA_sha512_2048/sha512d_key.pem | 27 + .../RSA_sha512_2048/sha512e_cert.p12 | Bin 0 -> 2629 bytes .../dummycerts/Test_sha1_1024_DER/dummy.txt | 0 192 files changed, 8657 insertions(+), 701 deletions(-) delete mode 100644 dotnet/dotnetcore/GeneXusFtpsNetCore/obj/project.nuget.cache create mode 100644 dotnet/dotnetframework/Directory.Build.props create mode 100644 test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestAsymmetricDomainSpaces.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestECDSASigning.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSAEncryption.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSASigning.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Checksum/TestChecksum.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashDomainSpaces.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashing.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestCmac.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestHmac.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/PasswordDerivation/TestPasswordDerivation.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestBlockEncryption.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestStreamEncryption.cs create mode 100644 test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestSymmetricDomainSpaces.cs create mode 100644 test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs create mode 100644 test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestAsymmetricJwt.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestCreateWithoutCert.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesPrimeJwt.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSecpJwt.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSectJwt.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtDiverseDataTypes.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtHeaderParameters.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtNestedClaims.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtRevocationList.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtVerifyJustSignature.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue81664.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue83649.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84142.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84859.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue86867.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtDomainSpaces.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtOtherFunctions.cs create mode 100644 test/dotnetframework/SecurityAPITest/Jwt/Symmetric/TestSymmetricJwt.cs create mode 100644 test/dotnetframework/SecurityAPITest/Properties/AssemblyInfo.cs create mode 100644 test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs create mode 100644 test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestBase64.cs create mode 100644 test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestHexa.cs create mode 100644 test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PrivateKey.cs create mode 100644 test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PublicKey.cs create mode 100644 test/dotnetframework/SecurityAPITest/SecurityAPITest.csproj create mode 100644 test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs create mode 100644 test/dotnetframework/SecurityAPITest/Temp/bookSample.xml create mode 100644 test/dotnetframework/SecurityAPITest/Temp/ftps/back/dummy.txt create mode 100644 test/dotnetframework/SecurityAPITest/Temp/ftps/ftpstest.txt create mode 100644 test/dotnetframework/SecurityAPITest/Temp/outputTestFilesC/dummy.txt create mode 100644 test/dotnetframework/SecurityAPITest/Temp/outputTestFilesJ/dummy.txt create mode 100644 test/dotnetframework/SecurityAPITest/Temp/sftptest/back/dummy.txt create mode 100644 test/dotnetframework/SecurityAPITest/Temp/sftptest/key/dummy.txt create mode 100644 test/dotnetframework/SecurityAPITest/Temp/sftptest/sftptest1.txt create mode 100644 test/dotnetframework/SecurityAPITest/Temp/tosign.xml create mode 100644 test/dotnetframework/SecurityAPITest/Temp/xmlID.xml create mode 100644 test/dotnetframework/SecurityAPITest/Temp/xmlIDSchema.xsd create mode 100644 test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestBase64Certificate.cs create mode 100644 test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestFindID.cs create mode 100644 test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs create mode 100644 test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha1/sha1_cert.crt create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha1/sha1_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha1/sha1_cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha1/sha1_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.crt create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha256.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha384.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha512.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.crt create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.pkcs12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1d_key.key create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1d_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1e_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.crt create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256d_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256e_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256_cert.crt create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256_cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256d_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256e_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.crt create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512d_key.pem create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512e_cert.p12 create mode 100644 test/dotnetframework/SecurityAPITest/dummycerts/Test_sha1_1024_DER/dummy.txt diff --git a/.gitignore b/.gitignore index 1a21554..09faa07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .vs/ packages/ -test/ dotnet/dotnetframework/SecurityAPICommons/bin/ dotnet/dotnetframework/SecurityAPICommons/obj/ dotnet/dotnetframework/GeneXusXmlSignature/obj/ @@ -63,3 +62,9 @@ dotnet/dotnetframework/GeneXusFtps/packages.config dotnet/dotnetcore/GeneXusFtpsNetCore/obj/ dotnet/resources/key.snk dotnet/dotnetcore/GeneXusFtpsNetCore/bin/ +/test/dotnetcore/SecurityAPITestNetCore/.runsettings +/test/dotnetframework/SecurityAPITest/.runsettings +/test/dotnetframework/SecurityAPITest/obj/Debug/net471/SecurityAPITest.AssemblyInfoInputs.cache +/test/dotnetframework/SecurityAPITest/obj/Debug/net471/SecurityAPITest.GeneratedMSBuildEditorConfig.editorconfig +/test/dotnetframework/SecurityAPITest/obj/Debug/net471/SecurityAPITest.csprojAssemblyReference.cache +/test/resources/key.snk diff --git a/SecurityAPIParent.sln b/SecurityAPIParent.sln index 0856a9d..398608c 100644 --- a/SecurityAPIParent.sln +++ b/SecurityAPIParent.sln @@ -7,29 +7,29 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{5CB172 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetframework", "dotnetframework", "{5EA71E19-9448-4F49-B24A-A5BF8964C54D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityAPICommons", "dotnet\dotnetframework\SecurityAPICommons\SecurityAPICommons.csproj", "{BE9A040C-DE9A-490A-B02C-9E1D97B30B21}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPICommons", "dotnet\dotnetframework\SecurityAPICommons\SecurityAPICommons.csproj", "{BE9A040C-DE9A-490A-B02C-9E1D97B30B21}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetcore", "dotnetcore", "{2B1F2BC4-723C-46F6-8C23-3FB82AF975E9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPICommonsNetCore", "dotnet\dotnetcore\SecurityAPICommonsNetCore\SecurityAPICommonsNetCore.csproj", "{A3C5EE4E-A9AA-408F-AE26-9E28154D1C39}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusCryptography", "dotnet\dotnetframework\GeneXusCryptography\GeneXusCryptography.csproj", "{420F7E79-1CC3-4FA6-8399-7C07B2EE94DE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusCryptography", "dotnet\dotnetframework\GeneXusCryptography\GeneXusCryptography.csproj", "{420F7E79-1CC3-4FA6-8399-7C07B2EE94DE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusCryptographyNetCore", "dotnet\dotnetcore\GeneXusCryptographyNetCore\GeneXusCryptographyNetCore.csproj", "{4E759B82-D093-43E4-BF34-923025AED531}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusXmlSignature", "dotnet\dotnetframework\GeneXusXmlSignature\GeneXusXmlSignature.csproj", "{291B2556-49D9-4775-823F-FCE5E2416C0A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusXmlSignature", "dotnet\dotnetframework\GeneXusXmlSignature\GeneXusXmlSignature.csproj", "{291B2556-49D9-4775-823F-FCE5E2416C0A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusXmlSignatureNetCore", "dotnet\dotnetcore\GeneXusXmlSignatureNetCore\GeneXusXmlSignatureNetCore.csproj", "{503D8578-4455-4DC0-ADDC-37E4C886427B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusJWT", "dotnet\dotnetframework\GeneXusJWT\GeneXusJWT.csproj", "{1D9FF129-BE37-4316-BFF3-9BEACC4612CB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusJWT", "dotnet\dotnetframework\GeneXusJWT\GeneXusJWT.csproj", "{1D9FF129-BE37-4316-BFF3-9BEACC4612CB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusJWTNetCore", "dotnet\dotnetcore\GeneXusJWTNetCore\GeneXusJWTNetCore.csproj", "{09DD9A8C-C6E8-47B2-BF68-D85BF5E6FC36}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusSftp", "dotnet\dotnetframework\GeneXusSftp\GeneXusSftp.csproj", "{7F864DEC-0EE0-420D-9976-9C7E39398161}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusSftp", "dotnet\dotnetframework\GeneXusSftp\GeneXusSftp.csproj", "{7F864DEC-0EE0-420D-9976-9C7E39398161}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusSftpNetCore", "dotnet\dotnetcore\GeneXusSftpNetCore\GeneXusSftpNetCore.csproj", "{1C8B841E-28A7-4D6B-95BE-47D2DDE1FE35}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneXusFtps", "dotnet\dotnetframework\GeneXusFtps\GeneXusFtps.csproj", "{76AD359D-960B-418D-8A1C-004E0E2D325C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusFtps", "dotnet\dotnetframework\GeneXusFtps\GeneXusFtps.csproj", "{76AD359D-960B-418D-8A1C-004E0E2D325C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneXusFtpsNetCore", "dotnet\dotnetcore\GeneXusFtpsNetCore\GeneXusFtpsNetCore.csproj", "{06054CD3-91A7-4A0A-AA5C-A70B64CF4755}" EndProject @@ -39,9 +39,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetcore", "dotnetcore", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnetframework", "dotnetframework", "{7F5F1DDC-09BE-4567-8CD4-41387AD91BEE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityAPITest", "test\dotnetframework\SecurityAPITest\SecurityAPITest.csproj", "{9100025A-68E0-4618-B83C-4D626CB89DBB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPITestNetCore", "test\dotnetcore\SecurityAPITestNetCore\SecurityAPITestNetCore.csproj", "{44B8B2B6-0842-4018-A547-EF33920EFC8E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPITest", "test\dotnetframework\SecurityAPITest\SecurityAPITest.csproj", "{9100025A-68E0-4618-B83C-4D626CB89DBB}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{88EB1BC4-0D68-4906-AA36-E1EA1F6AFD35}" ProjectSection(SolutionItems) = preProject @@ -49,6 +47,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{ dotnet\resources\Neon.SSH.NET.dll = dotnet\resources\Neon.SSH.NET.dll EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPITestNetCore", "test\dotnetcore\SecurityAPITestNetCore\SecurityAPITestNetCore.csproj", "{27D2471A-DA98-4912-A327-AF135550B034}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -107,10 +107,10 @@ Global {9100025A-68E0-4618-B83C-4D626CB89DBB}.Debug|Any CPU.Build.0 = Debug|Any CPU {9100025A-68E0-4618-B83C-4D626CB89DBB}.Release|Any CPU.ActiveCfg = Release|Any CPU {9100025A-68E0-4618-B83C-4D626CB89DBB}.Release|Any CPU.Build.0 = Release|Any CPU - {44B8B2B6-0842-4018-A547-EF33920EFC8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44B8B2B6-0842-4018-A547-EF33920EFC8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44B8B2B6-0842-4018-A547-EF33920EFC8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44B8B2B6-0842-4018-A547-EF33920EFC8E}.Release|Any CPU.Build.0 = Release|Any CPU + {27D2471A-DA98-4912-A327-AF135550B034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27D2471A-DA98-4912-A327-AF135550B034}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27D2471A-DA98-4912-A327-AF135550B034}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27D2471A-DA98-4912-A327-AF135550B034}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -133,8 +133,8 @@ Global {89FFECB3-7A69-41F8-88C7-F05193E5CDF4} = {750343D3-EAA6-433E-A099-71BC6851EA71} {7F5F1DDC-09BE-4567-8CD4-41387AD91BEE} = {750343D3-EAA6-433E-A099-71BC6851EA71} {9100025A-68E0-4618-B83C-4D626CB89DBB} = {7F5F1DDC-09BE-4567-8CD4-41387AD91BEE} - {44B8B2B6-0842-4018-A547-EF33920EFC8E} = {89FFECB3-7A69-41F8-88C7-F05193E5CDF4} {88EB1BC4-0D68-4906-AA36-E1EA1F6AFD35} = {5CB1725B-3FA5-49B1-A1F8-41EFCACA3CF1} + {27D2471A-DA98-4912-A327-AF135550B034} = {89FFECB3-7A69-41F8-88C7-F05193E5CDF4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AEB1693D-906F-402A-AD66-A1A9AE2ABBE2} diff --git a/dotnet/dotnetcore/GeneXusFtpsNetCore/obj/project.nuget.cache b/dotnet/dotnetcore/GeneXusFtpsNetCore/obj/project.nuget.cache deleted file mode 100644 index b2410ef..0000000 --- a/dotnet/dotnetcore/GeneXusFtpsNetCore/obj/project.nuget.cache +++ /dev/null @@ -1,70 +0,0 @@ -{ - "version": 2, - "dgSpecHash": "zBGgZrulZfk1lp+0T0RHS0cyKL09IXCvEhfouKtnC7w2ry9bSXA5TdXu43kZe+eaWuVCfkjW+Zhr/90czfNxFA==", - "success": true, - "projectFilePath": "C:\\git\\SecurityAPI\\DotNet-SecurityApi-Module\\dotnet\\dotnetcore\\GeneXusFtpsNetCore\\GeneXusFtpsNetCore.csproj", - "expectedPackageFiles": [ - "C:\\Users\\sgrampone\\.nuget\\packages\\fluentftp\\31.3.2\\fluentftp.31.3.2.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\microsoft.win32.primitives\\4.3.0\\microsoft.win32.primitives.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\portable.bouncycastle\\1.8.6.7\\portable.bouncycastle.1.8.6.7.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.native.system\\4.3.0\\runtime.native.system.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.native.system.net.http\\4.3.0\\runtime.native.system.net.http.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.native.system.net.security\\4.3.0\\runtime.native.system.net.security.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.native.system.security.cryptography.apple\\4.3.0\\runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple\\4.3.0\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl\\4.3.0\\runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.collections.concurrent\\4.3.0\\system.collections.concurrent.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.console\\4.3.0\\system.console.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.diagnostics.debug\\4.3.0\\system.diagnostics.debug.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.diagnostics.tracing\\4.3.0\\system.diagnostics.tracing.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.globalization\\4.3.0\\system.globalization.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.globalization.calendars\\4.3.0\\system.globalization.calendars.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.globalization.extensions\\4.3.0\\system.globalization.extensions.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.io\\4.3.0\\system.io.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.io.filesystem\\4.3.0\\system.io.filesystem.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.io.filesystem.primitives\\4.3.0\\system.io.filesystem.primitives.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.linq\\4.3.0\\system.linq.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.net.nameresolution\\4.3.0\\system.net.nameresolution.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.net.primitives\\4.3.0\\system.net.primitives.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.net.security\\4.3.0\\system.net.security.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.net.sockets\\4.3.0\\system.net.sockets.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.reflection\\4.3.0\\system.reflection.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.reflection.primitives\\4.3.0\\system.reflection.primitives.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.resources.resourcemanager\\4.3.0\\system.resources.resourcemanager.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.runtime\\4.3.0\\system.runtime.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.runtime.extensions\\4.3.0\\system.runtime.extensions.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.runtime.handles\\4.3.0\\system.runtime.handles.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.runtime.interopservices\\4.3.0\\system.runtime.interopservices.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.runtime.numerics\\4.3.0\\system.runtime.numerics.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.claims\\4.3.0\\system.security.claims.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.cryptography.algorithms\\4.3.0\\system.security.cryptography.algorithms.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.cryptography.cng\\4.7.0\\system.security.cryptography.cng.4.7.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.cryptography.csp\\4.3.0\\system.security.cryptography.csp.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.cryptography.encoding\\4.3.0\\system.security.cryptography.encoding.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.cryptography.openssl\\4.3.0\\system.security.cryptography.openssl.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.cryptography.primitives\\4.3.0\\system.security.cryptography.primitives.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.cryptography.x509certificates\\4.3.0\\system.security.cryptography.x509certificates.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.principal\\4.3.0\\system.security.principal.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.security.principal.windows\\4.3.0\\system.security.principal.windows.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.text.encoding\\4.3.0\\system.text.encoding.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.text.encoding.codepages\\4.3.0\\system.text.encoding.codepages.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.threading\\4.3.0\\system.threading.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.threading.tasks\\4.3.0\\system.threading.tasks.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.threading.thread\\4.3.0\\system.threading.thread.4.3.0.nupkg.sha512", - "C:\\Users\\sgrampone\\.nuget\\packages\\system.threading.threadpool\\4.3.0\\system.threading.threadpool.4.3.0.nupkg.sha512" - ], - "logs": [] -} \ No newline at end of file diff --git a/dotnet/dotnetframework/Directory.Build.props b/dotnet/dotnetframework/Directory.Build.props new file mode 100644 index 0000000..4085f74 --- /dev/null +++ b/dotnet/dotnetframework/Directory.Build.props @@ -0,0 +1,8 @@ + + + 17.4.0 + 17.4.0 + $([System.DateTime]::UtcNow.ToString("yyyy")) + Copyright © 1988-$(CopyrightYear) GeneXus. All Rights Reserved + + diff --git a/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj b/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj index a69004f..00f5d21 100644 --- a/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj +++ b/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj @@ -1,91 +1,16 @@ - - - - - Debug - AnyCPU - {420F7E79-1CC3-4FA6-8399-7C07B2EE94DE} - Library - Properties + + + net47 GeneXusCryptography GeneXusCryptographyImpl - v4.7 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - true - - ..\..\resources\key.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - {be9a040c-de9a-490a-b02c-9e1d97b30b21} - SecurityAPICommons - + @@ -94,5 +19,4 @@ - \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusCryptography/Properties/AssemblyInfo.cs b/dotnet/dotnetframework/GeneXusCryptography/Properties/AssemblyInfo.cs index 31744e6..44c59b4 100644 --- a/dotnet/dotnetframework/GeneXusCryptography/Properties/AssemblyInfo.cs +++ b/dotnet/dotnetframework/GeneXusCryptography/Properties/AssemblyInfo.cs @@ -6,33 +6,4 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("GeneXusCryptography")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeneXusCryptography")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("420f7e79-1cc3-4fa6-8399-7c07b2ee94de")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.4.0")] -[assembly: AssemblyFileVersion("17.4.0")] [assembly: AllowPartiallyTrustedCallers] diff --git a/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj b/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj index 61e5135..c1e91ba 100644 --- a/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj +++ b/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj @@ -1,68 +1,17 @@ - - - - - Debug - AnyCPU - {76AD359D-960B-418D-8A1C-004E0E2D325C} - Library - Properties + + + net47 + GeneXusFtps GeneXusFtpsImpl - v4.7 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - true - - ..\..\resources\key.snk - - - - - - - - - + - - - - - - - - - - - - - {be9a040c-de9a-490a-b02c-9e1d97b30b21} - SecurityAPICommons - + + @@ -70,5 +19,4 @@ - \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusFtps/Properties/AssemblyInfo.cs b/dotnet/dotnetframework/GeneXusFtps/Properties/AssemblyInfo.cs index 50e2873..44c59b4 100644 --- a/dotnet/dotnetframework/GeneXusFtps/Properties/AssemblyInfo.cs +++ b/dotnet/dotnetframework/GeneXusFtps/Properties/AssemblyInfo.cs @@ -6,33 +6,4 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("GeneXusFtps")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeneXusFtps")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("76ad359d-960b-418d-8a1c-004e0e2d325c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.4.0")] -[assembly: AssemblyFileVersion("17.4.0")] [assembly: AllowPartiallyTrustedCallers] diff --git a/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj b/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj index 1d229c6..2f9e053 100644 --- a/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj +++ b/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj @@ -1,76 +1,15 @@ - - - - - Debug - AnyCPU - {1D9FF129-BE37-4316-BFF3-9BEACC4612CB} - Library - Properties + + + net47 + GeneXusJWT GeneXusJWTImpl - v4.7 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - true - - ..\..\resources\key.snk App.$(Configuration).config - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - key.snk @@ -80,12 +19,16 @@ + + + + + + + + + - - {be9a040c-de9a-490a-b02c-9e1d97b30b21} - SecurityAPICommons - + - - \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusJWT/Properties/AssemblyInfo.cs b/dotnet/dotnetframework/GeneXusJWT/Properties/AssemblyInfo.cs index 790f0d2..d7e6547 100644 --- a/dotnet/dotnetframework/GeneXusJWT/Properties/AssemblyInfo.cs +++ b/dotnet/dotnetframework/GeneXusJWT/Properties/AssemblyInfo.cs @@ -6,33 +6,4 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("GeneXusJWT")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeneXusJWT")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1d9ff129-be37-4316-bff3-9beacc4612cb")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.4.0")] -[assembly: AssemblyFileVersion("17.4.0")] [assembly: AllowPartiallyTrustedCallers] \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj b/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj index b2283bc..ea9d0ee 100644 --- a/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj +++ b/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj @@ -1,75 +1,23 @@ - - - - - Debug - AnyCPU - {7F864DEC-0EE0-420D-9976-9C7E39398161} - Library - Properties + + + net47 + GeneXusSftp GeneXusSftpClientImpl - v4.7 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - true - - ..\..\resources\key.snk - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - ..\..\resources\Neon.SSH.NET.dll - - - - - - - - - - - - - - - - - key.snk - - - {be9a040c-de9a-490a-b02c-9e1d97b30b21} - SecurityAPICommons - + - \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusSftp/Properties/AssemblyInfo.cs b/dotnet/dotnetframework/GeneXusSftp/Properties/AssemblyInfo.cs index 7ee1e08..44c59b4 100644 --- a/dotnet/dotnetframework/GeneXusSftp/Properties/AssemblyInfo.cs +++ b/dotnet/dotnetframework/GeneXusSftp/Properties/AssemblyInfo.cs @@ -6,33 +6,4 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("GeneXusSftp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeneXusSftp")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7f864dec-0ee0-420d-9976-9c7e39398161")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.4.0")] -[assembly: AssemblyFileVersion("17.4.0")] [assembly: AllowPartiallyTrustedCallers] diff --git a/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj b/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj index 353fc74..fd2df2f 100644 --- a/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj +++ b/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj @@ -1,71 +1,12 @@ - - - - - Debug - AnyCPU - {291B2556-49D9-4775-823F-FCE5E2416C0A} - Library - Properties + + + net47 + GeneXusXmlSignature GeneXusXmlSignatureImpl - v4.7 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - true - - ..\..\resources\key.snk - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - key.snk @@ -73,11 +14,11 @@ - - {be9a040c-de9a-490a-b02c-9e1d97b30b21} - SecurityAPICommons - + + + + + + - - \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusXmlSignature/Properties/AssemblyInfo.cs b/dotnet/dotnetframework/GeneXusXmlSignature/Properties/AssemblyInfo.cs index 823622e..8c37939 100644 --- a/dotnet/dotnetframework/GeneXusXmlSignature/Properties/AssemblyInfo.cs +++ b/dotnet/dotnetframework/GeneXusXmlSignature/Properties/AssemblyInfo.cs @@ -3,36 +3,4 @@ using System.Runtime.InteropServices; using System.Security; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GeneXusXmlSignature")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeneXusXmlSignature")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("291b2556-49d9-4775-823f-fce5e2416c0a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.4.0")] -[assembly: AssemblyFileVersion("17.4.0")] [assembly: AllowPartiallyTrustedCallers] diff --git a/dotnet/dotnetframework/SecurityAPICommons/Config/AvailableEncoding.cs b/dotnet/dotnetframework/SecurityAPICommons/Config/AvailableEncoding.cs index 9b5c7f8..0cc41f5 100644 --- a/dotnet/dotnetframework/SecurityAPICommons/Config/AvailableEncoding.cs +++ b/dotnet/dotnetframework/SecurityAPICommons/Config/AvailableEncoding.cs @@ -102,7 +102,23 @@ public static string encapsulateGetString(byte[] input, AvailableEncoding availa { case AvailableEncoding.UTF_8: return Encoding.UTF8.GetString(input); +#if NETCORE + case AvailableEncoding.UTF_16: + Encoding utf16 = Encoding.GetEncoding(1201, new EncoderReplacementFallback(strUniRepChr), new DecoderReplacementFallback(strUniRepChr)); + string utf16_string = utf16.GetString(input); + return utf16_string.Replace(strUniRepChr, String.Empty); + case AvailableEncoding.UTF_16BE: + Encoding utf16_be = Encoding.GetEncoding(1201, new EncoderReplacementFallback(strUniRepChr), new DecoderReplacementFallback(strUniRepChr)); + string utf16_beString = utf16_be.GetString(input); + return utf16_beString.Replace(strUniRepChr, String.Empty); + + case AvailableEncoding.UTF_16LE: + Encoding utf16_le = Encoding.GetEncoding(1200, new EncoderReplacementFallback(strUniRepChr), new DecoderReplacementFallback(strUniRepChr)); + string utf16_leString = utf16_le.GetString(input); + return utf16_leString.Replace(strUniRepChr, String.Empty); + +#else case AvailableEncoding.UTF_16: return Encoding.BigEndianUnicode.GetString(input); @@ -111,7 +127,7 @@ public static string encapsulateGetString(byte[] input, AvailableEncoding availa case AvailableEncoding.UTF_16LE: return Encoding.Unicode.GetString(input); - +#endif case AvailableEncoding.UTF_32: @@ -180,7 +196,20 @@ public static byte[] encapsulateeGetBytes(string input, AvailableEncoding availa { case AvailableEncoding.UTF_8: return Encoding.UTF8.GetBytes(input); +#if NETCORE + case AvailableEncoding.UTF_16: + Encoding utf16 = Encoding.GetEncoding(1201, new EncoderReplacementFallback(strUniRepChr), new DecoderReplacementFallback(strUniRepChr)); + return utf16.GetBytes(input); + case AvailableEncoding.UTF_16BE: + Encoding utf16_be = Encoding.GetEncoding(1201, new EncoderReplacementFallback(strUniRepChr), new DecoderReplacementFallback(strUniRepChr)); + return utf16_be.GetBytes(input); + + case AvailableEncoding.UTF_16LE: + Encoding utf16_le = Encoding.GetEncoding(1200, new EncoderReplacementFallback(strUniRepChr), new DecoderReplacementFallback(strUniRepChr)); + return utf16_le.GetBytes(input); + +#else case AvailableEncoding.UTF_16: return Encoding.BigEndianUnicode.GetBytes(input); @@ -189,7 +218,7 @@ public static byte[] encapsulateeGetBytes(string input, AvailableEncoding availa case AvailableEncoding.UTF_16LE: return Encoding.Unicode.GetBytes(input); - +#endif case AvailableEncoding.UTF_32: Encoding cpUTF32_1 = Encoding.GetEncoding(12001, new EncoderReplacementFallback(strUniRepChr), new DecoderReplacementFallback(strUniRepChr)); diff --git a/dotnet/dotnetframework/SecurityAPICommons/Properties/AssemblyInfo.cs b/dotnet/dotnetframework/SecurityAPICommons/Properties/AssemblyInfo.cs index 273ff4e..4def279 100644 --- a/dotnet/dotnetframework/SecurityAPICommons/Properties/AssemblyInfo.cs +++ b/dotnet/dotnetframework/SecurityAPICommons/Properties/AssemblyInfo.cs @@ -1,38 +1,8 @@ using System.Reflection; -using System.Runtime.InteropServices; using System.Security; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("SecurityAPICommons")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SecurityAPICommons")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("be9a040c-de9a-490a-b02c-9e1d97b30b21")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("17.4.0")] -[assembly: AssemblyFileVersion("17.4.0")] [assembly: AllowPartiallyTrustedCallers] diff --git a/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj b/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj index b9fd0d3..8d9d87a 100644 --- a/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj +++ b/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj @@ -1,85 +1,21 @@ - - - - - Debug - AnyCPU - {BE9A040C-DE9A-490A-B02C-9E1D97B30B21} - Library - Properties - SecurityAPICommons + + + net47 GeneXusSecurityAPICommonsImpl - v4.7 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - + 17.4.0 true - - ..\..\resources\key.snk + - - - - ..\..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net46\System.Security.Cryptography.Algorithms.dll - - - ..\..\..\packages\System.Security.Cryptography.Cng.4.7.0\lib\net46\System.Security.Cryptography.Cng.dll - - - ..\..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + key.snk - - \ No newline at end of file diff --git a/dotnet/dotnetframework/SecurityAPICommons/Utils/ExtensionsWhiteList.cs b/dotnet/dotnetframework/SecurityAPICommons/Utils/ExtensionsWhiteList.cs index 55526b0..578c095 100644 --- a/dotnet/dotnetframework/SecurityAPICommons/Utils/ExtensionsWhiteList.cs +++ b/dotnet/dotnetframework/SecurityAPICommons/Utils/ExtensionsWhiteList.cs @@ -28,10 +28,6 @@ public void SetExtension(string value) [SecuritySafeCritical] public bool IsValid(string path) { - if (!IsValidName(path)) - { - return false; - } string ext = SecurityUtils.getFileExtension(path); for (int i = 0; i < this.whitelist.Count; i++) { @@ -53,23 +49,5 @@ public bool IsEmpty() return false; } - private bool IsValidName(string path) - { - int counter = 0; - int i = 0; - while (i < path.Length && counter <= 2) - { - if (path[i] == '.') - { - counter++; - } - i++; - } - if (counter >= 2) - { - return false; - } - return true; - } } } diff --git a/dotnet/dotnetframework/SecurityAPICommons/Utils/SecurityUtils.cs b/dotnet/dotnetframework/SecurityAPICommons/Utils/SecurityUtils.cs index a3a711e..ad7bc46 100644 --- a/dotnet/dotnetframework/SecurityAPICommons/Utils/SecurityUtils.cs +++ b/dotnet/dotnetframework/SecurityAPICommons/Utils/SecurityUtils.cs @@ -2,6 +2,7 @@ using Org.BouncyCastle.Utilities.Encoders; using SecurityAPICommons.Commons; using System; +using System.IO; using System.Security; namespace SecurityAPICommons.Utils @@ -50,12 +51,17 @@ public static bool extensionIs(string path, string ext) public static string getFileExtension(string path) { - int lastIndexOf = path.LastIndexOf("."); - if (lastIndexOf == -1) + string fileName = Path.GetFileName(path); + string extension; + try { - return ""; // empty extension + extension = Path.GetExtension(fileName); } - return path.Substring(lastIndexOf); + catch (Exception) + { + extension = ""; + } + return extension; } [SecuritySafeCritical] diff --git a/test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj b/test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj new file mode 100644 index 0000000..9bf1b50 --- /dev/null +++ b/test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj @@ -0,0 +1,740 @@ + + + + net5.0 + false + + + + + + + + + NETCORE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestAsymmetricDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestAsymmetricDomainSpaces.cs new file mode 100644 index 0000000..8391770 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestAsymmetricDomainSpaces.cs @@ -0,0 +1,48 @@ +using GeneXusCryptography.Asymmetric; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; +using System.IO; + +namespace SecurityAPITest.Cryptography.Asymmetric +{ + [TestFixture] + public class TestAsymmetricDomainSpaces : SecurityAPITestObject + { + private static string path_RSA_sha1_1024; + private static string plainText; + private static PrivateKeyManager key; + private static CertificateX509 cert; + private static string pathKey; + private static string pathCert; + private static AsymmetricCipher asymCipher; + + [SetUp] + public virtual void SetUp() + { + path_RSA_sha1_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha1_1024"); + plainText = "Lorem ipsum"; + pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.crt"); + key = new PrivateKeyManager(); + cert = new CertificateX509(); + asymCipher = new AsymmetricCipher(); + } + + [Test] + public void TestSpaces() + { + + key.Load(pathKey); + cert.Load(pathCert); + string encrypted1 = asymCipher.DoEncrypt_WithPrivateKey("SHA1 ", "PCKS1PADDING ", key, plainText); + //System.out.println("Error. Code: " + asymCipher.getErrorCode() + " Desc: " + asymCipher.getErrorDescription()); + Assert.IsFalse(asymCipher.HasError()); + + string decrypted = asymCipher.DoDecrypt_WithPublicKey(" SHA1", " PCKS1PADDING", cert, encrypted1); + Assert.IsFalse(asymCipher.HasError()); + Assert.IsTrue(SecurityUtils.compareStrings(plainText, decrypted)); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestECDSASigning.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestECDSASigning.cs new file mode 100644 index 0000000..bef600a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestECDSASigning.cs @@ -0,0 +1,140 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Keys; +using GeneXusCryptography.Asymmetric; +using System.IO; + +namespace SecurityAPITest.Cryptography.Asymmetric +{ + [TestFixture] + public class TestECDSASigning: SecurityAPITestObject + { + private static string path_ecdsa_sha1; + private static string path_ecdsa_sha256; + + private static string plainText; + + private static string alias; + private static string password; + + private static string[] encodings; + private static EncodingUtil eu; + + [SetUp] + public virtual void SetUp() + { + + path_ecdsa_sha1 = Path.Combine(BASE_PATH, "dummycerts", "ECDSA_sha1"); + path_ecdsa_sha256 = Path.Combine(BASE_PATH, "dummycerts", "ECDSA_sha256"); + + plainText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam venenatis ex sit amet risus pellentesque, a faucibus quam ultrices. Ut tincidunt quam eu aliquam maximus. Quisque posuere risus at erat blandit eleifend. Curabitur viverra rutrum volutpat. Donec quis quam tellus. Aenean fermentum elementum augue, a semper risus scelerisque sit amet. Nullam vitae sapien vitae dui ullamcorper dapibus quis quis leo. Sed neque felis, pellentesque in risus et, lobortis ultricies nulla. Quisque quis quam risus. Donec vestibulum, lectus vel vestibulum eleifend, velit ante volutpat lacus, ut mattis quam ligula eget est. Sed et pulvinar lectus. In mollis turpis non ipsum vehicula, sit amet rutrum nibh dictum. Duis consectetur convallis ex, eu ultricies enim bibendum vel. Vestibulum vel libero nibh. Morbi nec odio mattis, vestibulum quam blandit, pretium orci.Aenean pellentesque tincidunt nunc a malesuada. Etiam gravida fermentum mi, at dignissim dui aliquam quis. Nullam vel lobortis libero. Phasellus non gravida posuere"; + + alias = "1"; + password = "dummy"; + + encodings = new string[] { "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", + "GB2312" }; + + eu = new EncodingUtil(); + } + + [Test] + public void Test_ecdsa_sha1_PEM() + { + string pathKey = Path.Combine(path_ecdsa_sha1, "sha1_key.pem"); + string pathCert = Path.Combine(path_ecdsa_sha1, "sha1_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + + } + + [Test] + public void Test_ecdsa_sha1_DER() + { + string pathKey = Path.Combine(path_ecdsa_sha1, "sha1_key.pem"); + string pathCert = Path.Combine(path_ecdsa_sha1, "sha1_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + + } + + [Test] + public void Test_ecdsa_sha1_PKCS12() + { + string pathKey = Path.Combine(path_ecdsa_sha1, "sha1_cert.p12"); + string pathCert = Path.Combine(path_ecdsa_sha1, "sha1_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA1"); + } + + [Test] + public void Test_ecdsa_sha256_PEM() + { + string pathKey = Path.Combine(path_ecdsa_sha256, "sha256_key.pem"); + string pathCert = Path.Combine(path_ecdsa_sha256, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_ecdsa_sha256_DER() + { + string pathKey = Path.Combine(path_ecdsa_sha256, "sha256_key.pem"); + string pathCert = Path.Combine(path_ecdsa_sha256, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_ecdsa_sha256_PKCS12() + { + string pathKey = Path.Combine(path_ecdsa_sha256, "sha256_cert.p12"); + string pathCert = Path.Combine(path_ecdsa_sha256, "sha256_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA256"); + + } + + + private void bulkTest(PrivateKeyManager key, CertificateX509 cert, string hashAlgorithm) + { + AsymmetricSigner asymSig = new AsymmetricSigner(); + string signature = asymSig.DoSign(key, hashAlgorithm, plainText); + bool result = asymSig.DoVerify(cert, plainText, signature); + Assert.IsTrue(result); + True(result, asymSig); + } + + private void runTestWithEncoding(PrivateKeyManager key, CertificateX509 cert, string hash) + { + //{ "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", + //"GB2312" }; + for (int i = 0; i < encodings.Length; i++) + { + eu.setEncoding(encodings[i]); + bulkTest(key, cert, hash); + } + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSAEncryption.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSAEncryption.cs new file mode 100644 index 0000000..5c32471 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSAEncryption.cs @@ -0,0 +1,330 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Keys; +using GeneXusCryptography.Asymmetric; +using SecurityAPICommons.Utils; +using System.IO; + +namespace SecurityAPITest.Cryptography.Asymmetric +{ + [TestFixture] + public class TestRSAEncryption: SecurityAPITestObject + { + private static string path_RSA_sha1_1024; + private static string path_RSA_sha256_1024; + private static string path_RSA_sha256_2048; + private static string path_RSA_sha512_2048; + + private static string[] arrayPaddings; + + private static string plainText; + + private static string plainText16; + private static string plainText32; + + private static string alias; + private static string password; + + private static string[] encodings; + private static EncodingUtil eu; + + [SetUp] + public virtual void SetUp() + { + + path_RSA_sha1_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha1_1024"); + path_RSA_sha256_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_1024"); + path_RSA_sha256_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_2048"); + path_RSA_sha512_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha512_2048"); + + arrayPaddings = new string[] { "OAEPPADDING", "PCKS1PADDING", "ISO97961PADDING" }; + + plainText = ""; + plainText16 = "Lorem ipsum dolor sit amet"; + plainText32 = "Lorem ipsum"; + + alias = "1"; + password = "dummy"; + + encodings = new string[] { "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", + "GB2312" }; + + eu = new EncodingUtil(); + + } + + [Test] + public void Test_sha1_1024_DER() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + + } + + [Test] + public void Test_sha1_1024_PEM() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + + } + + + + [Test] + public void Test_sha1_1024_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA1"); + + } + + [Test] + public void Test_sha256_1024_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha256_1024_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + + + [Test] + public void Test_sha256_1024_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha256_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha256_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + + + [Test] + public void Test_sha256_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha512_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA512"); + + } + + [Test] + public void Test_sha512_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA512"); + + } + + + + [Test] + public void Test_sha512_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA512"); + + } + + [Test] + public void Test_base64() + { + string base64stringCert = "MIIC/DCCAmWgAwIBAgIJAPmCVmfcc0IXMA0GCSqGSIb3DQEBCwUAMIGWMQswCQYDVQQGEwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQMA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNncmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4XDTIwMDcwODE4NDkxNVoXDTI1MDcwNzE4NDkxNVowgZYxCzAJBgNVBAYTAlVZMRMwEQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQKDAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25lMSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMZ8m4ftIhfrdugi5kEszRZr5IRuqGDLTex+CfVnhnBYXyQgJXeCI0eyRYUAbNzw/9MPdFN//pV26AXeH/ajORVu1JVoOACZdNOIPFnwXXh8oBxNxLAYlqoK2rAL+/tns8rKqqS4p8HSat9tj07TUXnsYJmmbXJM/eB94Ex66D1ZAgMBAAGjUDBOMB0GA1UdDgQWBBTfXY8eOfDONCZpFE0V34mJJeCYtTAfBgNVHSMEGDAWgBTfXY8eOfDONCZpFE0V34mJJeCYtTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBAAPv7AFlCSpJ32c/VYowlbk6UBhOKmVWBQlrAtvVQYtCKO/y9CEB8ikG19c8lHM9axnsbZR+G7g04Rfuiea3T7VPkSmUXPpz5fl6Zyk4LZg5Oji7MMMXGmr+7cpYWRhifCVwoxSgZEXt3d962IZ1Wei0LMO+4w4gnzPxqr8wVHnT"; + string base64stringKey = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMZ8m4ftIhfrdugi5kEszRZr5IRuqGDLTex+CfVnhnBYXyQgJXeCI0eyRYUAbNzw/9MPdFN//pV26AXeH/ajORVu1JVoOACZdNOIPFnwXXh8oBxNxLAYlqoK2rAL+/tns8rKqqS4p8HSat9tj07TUXnsYJmmbXJM/eB94Ex66D1ZAgMBAAECgYA1xrTs0taV3HnO0wXHSrgWBw1WxBRihTKLjGpuTqoh7g943izIgD3GwwoKyt6zzafCK0G9DcSQAjNCw7etPvPL3FxwhDl+AHSv9JcChk/auICtMWwjurG4npto+s3byj/N00Idpz1xuOgKd8k9sdoPBGKa8l+LL+adSXzoivLG8QJBAPDvbOLSs9petB2iM6w5/DiC8EoxqDaBc7I1JFCvPOfB7i1GFFxkQ7hlgxpvaPX3NHXjAZpgdOW68P/SjU0izKsCQQDS5bjrNo3xn/MbYKojzwprR/Bo8Kvbi4/2M9NE3GwHegVmx5I+df+J0aObrbBNPLs/rhrFtt12OtgxJaac+FYLAkEA8DUUbvO4wj7m/iBnug65irHo1V+6oFThv0tCIHsFkt4DEvoqdI62AZKbafCnSYqjr+CaCYqfIScG/Vay77OBLwJBAI8EYAmKPmn7+SW4wMh1z+/+ogbYJwNEOoVQkdXh0JSlZ+JSNleLN5ajhtq8x5EpPSYrEFbB8p8JurBhgwJx2g8CQQDrp9scoK8eKBJ2p/63xqLGYSN6OZQo/4Lkq3983rmHoDCAp3Bz1zUyxQB3UVyrOj4U44C7RtDNiMSZuCwvjYAI"; + PrivateKeyManager key = new PrivateKeyManager(); + key.FromBase64(base64stringKey); + CertificateX509 cert = new CertificateX509(); + cert.FromBase64(base64stringCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + + + private void bulkTest(PrivateKeyManager privateKey, CertificateX509 cert, string hashAlgorithm) + { + string enc = Global.GLOBAL_ENCODING; + if (SecurityUtils.compareStrings(enc, "UTF_32") || SecurityUtils.compareStrings(enc, "UTF_32BE") + || SecurityUtils.compareStrings(enc, "UTF_32LE")) + { + plainText = eu.getString(eu.getBytes(plainText32)); + } + else + { + + plainText = eu.getString(eu.getBytes(plainText16)); + } + + for (int p = 0; p < arrayPaddings.Length; p++) + { + + AsymmetricCipher asymCipher = new AsymmetricCipher(); + // AsymmetricCipher asymCipherD = new AsymmetricCipher(); + string encrypted1 = asymCipher.DoEncrypt_WithPrivateKey(hashAlgorithm, arrayPaddings[p], privateKey, + plainText); + string decrypted1 = asymCipher.DoDecrypt_WithPublicKey(hashAlgorithm, arrayPaddings[p], cert, encrypted1); + + Assert.AreEqual(decrypted1, plainText); + True(SecurityUtils.compareStrings(decrypted1, plainText), asymCipher); + string encrypted2 = asymCipher.DoEncrypt_WithPublicKey(hashAlgorithm, arrayPaddings[p], cert, plainText); + string decrypted2 = asymCipher.DoDecrypt_WithPrivateKey(hashAlgorithm, arrayPaddings[p], privateKey, + encrypted2); + Assert.IsTrue(SecurityUtils.compareStrings(decrypted2, plainText)); + True(SecurityUtils.compareStrings(decrypted2, plainText), asymCipher); + } + } + + private void runTestWithEncoding(PrivateKeyManager key, CertificateX509 cert, string hash) + { + for (int i = 0; i < encodings.Length; i++) + { + eu.setEncoding(encodings[i]); + bulkTest(key, cert, hash); + } + } + + [Test] + public void Test_sha1_1024_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + + } + + [Test] + public void Test_sha256_1024_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha256_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha512_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA512"); + + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSASigning.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSASigning.cs new file mode 100644 index 0000000..1b5b516 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Asymmetric/TestRSASigning.cs @@ -0,0 +1,295 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using NUnit.Framework; +using SecurityAPICommons.Config; +using GeneXusCryptography.Asymmetric; +using SecurityAPICommons.Keys; +using System.IO; + +namespace SecurityAPITest.Cryptography.Asymmetric +{ + [TestFixture] + public class TestRSASigning: SecurityAPITestObject + { + + private static string path_RSA_sha1_1024; + private static string path_RSA_sha256_1024; + private static string path_RSA_sha256_2048; + private static string path_RSA_sha512_2048; + private static string[] encodings; + private static EncodingUtil eu; + + //private static String[] arrayPaddings; + + private static string plainText; + + public static string alias; + public static string password; + + [SetUp] + public virtual void SetUp() + { + + path_RSA_sha1_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha1_1024"); + path_RSA_sha256_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_1024"); + path_RSA_sha256_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_2048"); + path_RSA_sha512_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha512_2048"); + + //arrayPaddings = new String[] { "OAEPPADDING", "PCKS1PADDING", "ISO97961PADDING" }; + + plainText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam venenatis ex sit amet risus pellentesque, a faucibus quam ultrices. Ut tincidunt quam eu aliquam maximus. Quisque posuere risus at erat blandit eleifend. Curabitur viverra rutrum volutpat. Donec quis quam tellus. Aenean fermentum elementum augue, a semper risus scelerisque sit amet. Nullam vitae sapien vitae dui ullamcorper dapibus quis quis leo. Sed neque felis, pellentesque in risus et, lobortis ultricies nulla. Quisque quis quam risus. Donec vestibulum, lectus vel vestibulum eleifend, velit ante volutpat lacus, ut mattis quam ligula eget est. Sed et pulvinar lectus. In mollis turpis non ipsum vehicula, sit amet rutrum nibh dictum. Duis consectetur convallis ex, eu ultricies enim bibendum vel. Vestibulum vel libero nibh. Morbi nec odio mattis, vestibulum quam blandit, pretium orci.Aenean pellentesque tincidunt nunc a malesuada. Etiam gravida fermentum mi, at dignissim dui aliquam quis. Nullam vel lobortis libero. Phasellus non gravida posuere"; + + alias = "1"; + password = "dummy"; + + encodings = new string[] { "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", "GB2312" }; + + eu = new EncodingUtil(); + } + + [Test] + public void Test_sha1_1024_DER() + { + + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + } + + [Test] + public void Test_sha1_1024_PEM() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + + } + + + + [Test] + public void Test_sha1_1024_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA1"); + + } + + [Test] + public void Test_sha256_1024_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha256_1024_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + + + [Test] + public void Test_sha256_1024_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha256_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha256_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + + + [Test] + public void Test_sha256_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha512_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA512"); + + } + + [Test] + public void Test_sha512_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA512"); + + } + + + + [Test] + public void Test_sha512_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadPKCS12(pathKey, alias, password); + CertificateX509 cert = new CertificateX509(); + cert.LoadPKCS12(pathCert, alias, password); + runTestWithEncoding(key, cert, "SHA512"); + } + + [Test] + public void Test_base64() + { + string base64stringCert = "MIIC/DCCAmWgAwIBAgIJAPmCVmfcc0IXMA0GCSqGSIb3DQEBCwUAMIGWMQswCQYDVQQGEwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQMA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNncmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4XDTIwMDcwODE4NDkxNVoXDTI1MDcwNzE4NDkxNVowgZYxCzAJBgNVBAYTAlVZMRMwEQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQKDAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25lMSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMZ8m4ftIhfrdugi5kEszRZr5IRuqGDLTex+CfVnhnBYXyQgJXeCI0eyRYUAbNzw/9MPdFN//pV26AXeH/ajORVu1JVoOACZdNOIPFnwXXh8oBxNxLAYlqoK2rAL+/tns8rKqqS4p8HSat9tj07TUXnsYJmmbXJM/eB94Ex66D1ZAgMBAAGjUDBOMB0GA1UdDgQWBBTfXY8eOfDONCZpFE0V34mJJeCYtTAfBgNVHSMEGDAWgBTfXY8eOfDONCZpFE0V34mJJeCYtTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBAAPv7AFlCSpJ32c/VYowlbk6UBhOKmVWBQlrAtvVQYtCKO/y9CEB8ikG19c8lHM9axnsbZR+G7g04Rfuiea3T7VPkSmUXPpz5fl6Zyk4LZg5Oji7MMMXGmr+7cpYWRhifCVwoxSgZEXt3d962IZ1Wei0LMO+4w4gnzPxqr8wVHnT"; + string base64stringKey = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMZ8m4ftIhfrdugi5kEszRZr5IRuqGDLTex+CfVnhnBYXyQgJXeCI0eyRYUAbNzw/9MPdFN//pV26AXeH/ajORVu1JVoOACZdNOIPFnwXXh8oBxNxLAYlqoK2rAL+/tns8rKqqS4p8HSat9tj07TUXnsYJmmbXJM/eB94Ex66D1ZAgMBAAECgYA1xrTs0taV3HnO0wXHSrgWBw1WxBRihTKLjGpuTqoh7g943izIgD3GwwoKyt6zzafCK0G9DcSQAjNCw7etPvPL3FxwhDl+AHSv9JcChk/auICtMWwjurG4npto+s3byj/N00Idpz1xuOgKd8k9sdoPBGKa8l+LL+adSXzoivLG8QJBAPDvbOLSs9petB2iM6w5/DiC8EoxqDaBc7I1JFCvPOfB7i1GFFxkQ7hlgxpvaPX3NHXjAZpgdOW68P/SjU0izKsCQQDS5bjrNo3xn/MbYKojzwprR/Bo8Kvbi4/2M9NE3GwHegVmx5I+df+J0aObrbBNPLs/rhrFtt12OtgxJaac+FYLAkEA8DUUbvO4wj7m/iBnug65irHo1V+6oFThv0tCIHsFkt4DEvoqdI62AZKbafCnSYqjr+CaCYqfIScG/Vay77OBLwJBAI8EYAmKPmn7+SW4wMh1z+/+ogbYJwNEOoVQkdXh0JSlZ+JSNleLN5ajhtq8x5EpPSYrEFbB8p8JurBhgwJx2g8CQQDrp9scoK8eKBJ2p/63xqLGYSN6OZQo/4Lkq3983rmHoDCAp3Bz1zUyxQB3UVyrOj4U44C7RtDNiMSZuCwvjYAI"; + PrivateKeyManager key = new PrivateKeyManager(); + key.FromBase64(base64stringKey); + CertificateX509 cert = new CertificateX509(); + cert.FromBase64(base64stringCert); + runTestWithEncoding(key, cert, "SHA256"); + } + + private void bulkTest(PrivateKeyManager key, CertificateX509 cert, string hashAlgorithm) + { + AsymmetricSigner asymSig = new AsymmetricSigner(); + string signature = asymSig.DoSign(key, hashAlgorithm, plainText); + bool result = asymSig.DoVerify(cert, plainText, signature); + Assert.IsTrue(result); + True(result, asymSig); + } + + private void runTestWithEncoding(PrivateKeyManager key, CertificateX509 cert, string hash) + { + for (int i = 0; i < encodings.Length; i++) + { + eu.setEncoding(encodings[i]); + bulkTest(key, cert, hash); + } + } + + [Test] + public void Test_sha256_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha512_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA512"); + + } + + [Test] + public void Test_sha256_1024_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA256"); + + } + + [Test] + public void Test_sha1_1024_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.LoadEncrypted(pathKey, password); + CertificateX509 cert = new CertificateX509(); + cert.Load(pathCert); + runTestWithEncoding(key, cert, "SHA1"); + + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Checksum/TestChecksum.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Checksum/TestChecksum.cs new file mode 100644 index 0000000..6e97837 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Checksum/TestChecksum.cs @@ -0,0 +1,136 @@ +using GeneXusCryptography.Checksum; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; +using System.IO; + +namespace SecurityAPITest.Cryptography.Checksum +{ + [TestFixture] + public class TestChecksum : SecurityAPITestObject + { + private static string input; + private static string b64Input; + private static string hexaInput; + private static string localFileInput; + private static string[] algorithms; + private static string[] results; + private static string[] results0x; + private static string[] resultsLocalFile; + private static string[] resultsLocalFile0x; + private static string[] inputTypes; + private static string[] inputs; + + [SetUp] + protected virtual void SetUp() + { + new EncodingUtil().setEncoding("UTF8"); + input = "123456789"; + b64Input = "MTIzNDU2Nzg5"; + hexaInput = "313233343536373839"; + localFileInput = Path.Combine(BASE_PATH, "Temp", "bookSample.xml"); + + inputs = new string[] { input, input, b64Input, hexaInput }; + inputTypes = new string[] { "ASCII", "TXT", "BASE64", "HEX" }; + algorithms = new string[] { "CRC8", "CRC8_CDMA2000", "CRC8_DARC", "CRC8_DVB_S2", "CRC8_EBU", "CRC8_I_CODE", + "CRC8_ITU", "CRC8_MAXIM", "CRC8_ROHC", "CRC8_WCDMA", "CRC16_AUG_CCITT", "CRC16_CCITT_FALSE", + "CRC16_ARC", "CRC16_BUYPASS", "CRC16_CDMA2000", "CRC16_DDS_110", "CRC16_DECT_R", "CRC16_DECT_X", + "CRC16_DNP", "CRC16_EN_13757", "CRC16_GENIBUS", "CRC16_MAXIM", "CRC16_MCRF4XX", "CRC16_RIELLO", + "CRC16_T10_DIF", "CRC16_TELEDISK", "CRC16_TMS_37157", "CRC16_USB", "CRC_A", "CRC16_KERMIT", + "CRC16_MODBUS", "CRC16_X_25", "CRC16_XMODEM", "CRC32", "CRC32_BZIP2", "CRC32C", "CRC32D", + "CRC32_MPEG_2", "CRC32_POSIX", "CRC32Q", "CRC32_JAMCRC", "CRC32_XFER", "MD5", "SHA1", "SHA256", + "SHA512" }; + results = new string[] { "F4", "DA", "15", "BC", "97", "7E", "A1", "A1", "D0", "25", "E5CC", "29B1", "BB3D", + "FEE8", "4C06", "9ECF", "007E", "007F", "EA82", "C2B7", "D64E", "44C2", "6F91", "63D0", "D0DB", "0FB3", + "26B1", "B4C8", "BF05", "2189", "4B37", "906E", "31C3", "CBF43926", "FC891918", "E3069283", "87315576", + "0376E6E7", "765E7680", "3010BF7F", "340BC6D9", "BD0BE338", "25F9E794323B453885F5181F1B624D0B", + "F7C3BC1D808E04732ADF679965CCC34CA7AE3441", + "15E2B0D3C33891EBB0F1EF609EC419420C20E320CE94C65FBC8C3312448EB225", + "D9E6762DD1C8EAF6D61B3C6192FC408D4D6D5F1176D0C29169BC24E71C3F274AD27FCD5811B313D681F7E55EC02D73D499C95455B6B5BB503ACF574FBA8FFE85" }; + results0x = new string[] { "0xF4", "0xDA", "0x15", "0xBC", "0x97", "0x7E", "0xA1", "0xA1", "0xD0", "0x25", "0xE5CC", "0x29B1", "0xBB3D", + "0xFEE8", "0x4C06", "0x9ECF", "0x007E", "0x007F", "0xEA82", "0xC2B7", "0xD64E", "0x44C2", "0x6F91", "0x63D0", "0xD0DB", "0x0FB3", + "0x26B1", "0xB4C8", "0xBF05", "0x2189", "0x4B37", "0x906E", "0x31C3", "0xCBF43926", "0xFC891918", "0xE3069283", "0x87315576", + "0x0376E6E7", "0x765E7680", "0x3010BF7F", "0x340BC6D9", "0xBD0BE338", "0x25F9E794323B453885F5181F1B624D0B", + "0xF7C3BC1D808E04732ADF679965CCC34CA7AE3441", + "0x15E2B0D3C33891EBB0F1EF609EC419420C20E320CE94C65FBC8C3312448EB225", + "0xD9E6762DD1C8EAF6D61B3C6192FC408D4D6D5F1176D0C29169BC24E71C3F274AD27FCD5811B313D681F7E55EC02D73D499C95455B6B5BB503ACF574FBA8FFE85" }; + resultsLocalFile = new string[] { "AD", "C2", "C0", "29", "AC", "C6", "F8", "58", "E9", "BA", "E7BF", "EB02", + "7982", "8DC7", "8023", "347E", "78ED", "78EC", "1223", "F11E", "14FD", "867D", "8690", "8656", "89CC", + "D6A3", "FF40", "1452", "47D3", "12A7", "EBAD", "796F", "072B", "3172BC69", "18D27AE6", "8C403DED", + "3B83323F", "E72D8519", "981F81DA", "323A5936", "CE8D4396", "ABBC544E", + "19D987515BC23D6D8A29AD2A063A58ED", "1DCC48655437412E56A0B66E214DE0A91B0F888F", + "5248D4A7D1A6588AB8BABDE9487D43579CA957DED6ED553AF04D506702100C9F", + "5C7B1671D81B37FB4A1B8DF4E23091D10181F2D3559BD3B5515C23F8F042CF8A60E26EAC5A70D8E2AC7B8585CAAB7F42480213D5771FC5430E550F2D429349FA" }; + resultsLocalFile0x = new string[] { "0xAD", "0xC2", "0xC0", "0x29", "0xAC", "0xC6", "0xF8", "0x58", "0xE9", + "0xBA", "0xE7BF", "0xEB02", "0x7982", "0x8DC7", "0x8023", "0x347E", "0x78ED", "0x78EC", "0x1223", + "0xF11E", "0x14FD", "0x867D", "0x8690", "0x8656", "0x89CC", "0xD6A3", "0xFF40", "0x1452", "0x47D3", + "0x12A7", "0xEBAD", "0x796F", "0x072B", "0x3172BC69", "0x18D27AE6", "0x8C403DED", "0x3B83323F", + "0xE72D8519", "0x981F81DA", "0x323A5936", "0xCE8D4396", "0xABBC544E", + "0x19D987515BC23D6D8A29AD2A063A58ED", "0x1DCC48655437412E56A0B66E214DE0A91B0F888F", + "0x5248D4A7D1A6588AB8BABDE9487D43579CA957DED6ED553AF04D506702100C9F", + "0x5C7B1671D81B37FB4A1B8DF4E23091D10181F2D3559BD3B5515C23F8F042CF8A60E26EAC5A70D8E2AC7B8585CAAB7F42480213D5771FC5430E550F2D429349FA" }; + } + + [Test] + public void TestBulkChecksum() + { + ChecksumCreator check = new ChecksumCreator(); + for (int j = 0; j < inputs.Length; j++) + { + for (int i = 0; i < algorithms.Length; i++) + { + string checksum = check.GenerateChecksum(inputs[j], inputTypes[j], algorithms[i]); + Assert.IsTrue(SecurityUtils.compareStrings(checksum, results[i])); + bool verify = check.VerifyChecksum(inputs[j], inputTypes[j], algorithms[i], checksum); + True(verify, check); + } + } + + } + + [Test] + public void TestBulkChecksum0x() + { + ChecksumCreator check = new ChecksumCreator(); + for (int j = 0; j < inputs.Length; j++) + { + for (int i = 0; i < algorithms.Length; i++) + { + string checksum = check.GenerateChecksum(inputs[j], inputTypes[j], algorithms[i]); + Assert.IsTrue(SecurityUtils.compareStrings(checksum, results[i])); + bool verify = check.VerifyChecksum(inputs[j], inputTypes[j], algorithms[i], results0x[i].ToLower()); + True(verify, check); + } + } + + } + + [Test] + public void TestBulkChecksum_LocalFile() + { + ChecksumCreator check = new ChecksumCreator(); + for (int k = 0; k < algorithms.Length; k++) + { + string checksum = check.GenerateChecksum(localFileInput, "LOCAL_FILE", algorithms[k]); + Assert.IsTrue(SecurityUtils.compareStrings(checksum, resultsLocalFile[k])); + bool verify = check.VerifyChecksum(localFileInput, "LOCAL_FILE", algorithms[k], checksum); + True(verify, check); + } + } + + [Test] + public void TestBulkChecksum0x_LocalFile() + { + ChecksumCreator check = new ChecksumCreator(); + for (int k = 0; k < algorithms.Length; k++) + { + string checksum = check.GenerateChecksum(localFileInput, "LOCAL_FILE", algorithms[k]); + Assert.IsTrue(SecurityUtils.compareStrings(checksum, resultsLocalFile[k])); + bool verify = check.VerifyChecksum(localFileInput, "LOCAL_FILE", algorithms[k], + resultsLocalFile0x[k].ToLower()); + True(verify, check); + } + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashDomainSpaces.cs new file mode 100644 index 0000000..802e2f8 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashDomainSpaces.cs @@ -0,0 +1,31 @@ +using GeneXusCryptography.Hash; +using NUnit.Framework; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.Cryptography.Hash +{ + [TestFixture] + public class TestHashDomainSpaces : SecurityAPITestObject + { + protected static string plainText; + protected static string SHA1Digest = "38F00F8738E241DAEA6F37F6F55AE8414D7B0219"; + protected static Hashing hash; + + [SetUp] + public virtual void SetUp() + { + SHA1Digest = "38F00F8738E241DAEA6F37F6F55AE8414D7B0219"; + hash = new Hashing(); + plainText = "Lorem ipsum dolor sit amet"; + } + + [Test] + public void TestSpaces() + { + string digest = hash.DoHash(" SHA1", plainText); + Assert.IsFalse(hash.HasError()); + Assert.IsTrue(SecurityUtils.compareStrings(digest, SHA1Digest)); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashing.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashing.cs new file mode 100644 index 0000000..b78e03b --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Hash/TestHashing.cs @@ -0,0 +1,88 @@ +using System; +using GeneXusCryptography.Hash; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.Cryptography.Hash +{ + [TestFixture] + public class TestHashing: SecurityAPITestObject + { + protected static string plainText; + protected string[] arrayHashes; + protected string[] arrayResHashes; + + [SetUp] + protected virtual void SetUp() + { + new EncodingUtil().setEncoding("UTF8"); + string MD5 = "FEA80F2DB003D4EBC4536023814AA885"; + string SHA1 = "38F00F8738E241DAEA6F37F6F55AE8414D7B0219"; + string SHA224 = "B3F933DCF0CD5C02169F6FFB9E9DD156E6A378F64DD992D5768BA020"; + string SHA256 = "16ABA5393AD72C0041F5600AD3C2C52EC437A2F0C7FC08FADFC3C0FE9641D7A3"; + string SHA384 = "95A0541E1E04F0C65701902FD92329070BDC7001477B0B9B280C79BC1ADDC9D8C305E97A8BDECDC3E6024069AE97A2CD"; + string SHA512 = "B1F4AAA6B51C19FFBE4B1B6FA107BE09C8ACAFD7C768106A3FAF475B1E27A940D3C075FDA671EADF46C68F93D7EABCF604BCBF7055DA0DC4EAE6743607A2FC3F"; + string BLAKE2B_224 = "CFD4B035CD7F135A65E196FD5220FD232D499017F153D7A12AAC48EE"; + string BLAKE2B_256 = "43D3205918BBB6A0175A949BD5AA77F6AC87184F8459ED9EA66387773B4121A5"; + string BLAKE2B_384 = "44BC61A7DD4447862D2DB262338A6ABF2B3FFCC3E05CBE4C0ED279157FCCDB36BE66B67F7733ABA902CE6AF65B733B31"; + string BLAKE2B_512 = "965F6293650C11D0AFB91385AFA89F937A468E1F693C5402D369431347E4DC22800A9DCF425B27BFA884E05C80F9D2F23797CA6DB3CD357383D3C6DCA8BA68CA"; + string BLAKE2S_128 = "20CBE99525EC7A3B20BC2A5F9A6B0A01"; + string BLAKE2S_160 = "08E46034CD071C09DAAFF949AA47652E32BC4029"; + string BLAKE2S_224 = "7DF368CC11D65AF123CBDEE9ABDDEC3B09AB879AAD1BD3EBE6E512F0"; + string BLAKE2S_256 = "52FEE5030C5B61C42DB2DC09435BC6E6F357AAFA450C23F0C4DB8F2D44C7C3A6"; + string GOST3411_2012_256 = "2FB0AA06A692B00A1905BE6AF797F24C976B6746DE31D5A67A096E685EFB4489"; + string GOST3411_2012_512 = "C5DC8AF567D3183040C6CDC1F19F38FC6345B0513D02EBF9D2054690D85DD38271E38F3C0069A9C0891764E9F94E627D1245C6D718C4194AA3E594E209639453"; + string GOST3411 = "47B222D3029D84F229DB1798942A1192F5BA27D3647F12DD0F735DD0C420C160"; + string KECCAK_224 = "8AF0DB4E1481E9E8704312634537664FA634932E92236DED8B2AA348"; + string KECCAK_256 = "B53B7CA515051D49E851C07BD0FBDDDB8010A9366F5B1F5FB737BA21A4356301"; + string KECCAK_288 = "5F73ABD3095975571EBC94BAC6D9840CC888D81A9FD2BF524D1F9F37E422E736C7EE47CC"; + string KECCAK_384 = "C31C889B72BAEBEC30903190864B0035A5058C3A79A45A5E488DC4FFA7E81D881F6B85DD3493C222925B79E90B8AEDED"; + string KECCAK_512 = "21FDB61F9F82B8D20930B43D51DC7FE0E931D2E18E957F3B5316D147FE3E2E5EC567457D0894A6BF867595A1A1AA1303FB19D57D2DA5921119C8EC801FC1F68D"; + string MD2 = "854BF540A75F548906201F479526C1BA"; + string MD4 = "69740FE64C87D1DF772D8B8BAC7FCC26"; + string RIPEMD128 = "52EE689604C15591ED9EF6A0BDF6FD28"; + string RIPEMD160 = "7D0982BE59EBE828D02AA0D031AA6651644D60DA"; + string RIPEMD256 = "49A275CDAC39B746C0E0DCFBCE97144940863F83DF4EA8A0833874496BC84102"; + string RIPEMD320 = "969607288B7E788A239B91803AC0187530F16242AA314CFD06CBE780E2377CFA200A2288DB019BFD"; + string SHA3_224 = "F75F9AFF421AB1A2BF95B997144F184ACF97F2BCD4FFB854B8C7377D"; + string SHA3_256 = "AFBE560C8EA52AF055471E6AEDB33B104F2A2373CE642B251A9F5F25E669BF66"; + string SHA3_384 = "4E1389E97F01ACB13A88AF18FCA572CEFE56926612315F797C6D2CB0F5EEA3BF4FD2623D3E3A388B14225F2DEE806F2A"; + string SHA3_512 = "8571AE21DB0FE5F7EEE18B029557038B61C024773A625082FA528DBCD19737A828663CB4D51726865B959AB6961D609DD1FEEBC251A575BED0DD8661BE2B83C1"; + string SHAKE_128 = "22E24D7A4D4CD0FFC803529449287D60"; + string SHAKE_256 = "F4112786511DF1AD767E69121859269D4BE0C910A0E88848D8DD887D49741B5E"; + string SM3 = "2F097B534D5FC00AF295A8ECA9CC7B75DFCD1C1F9E272B406626DC98908244D7"; + string TIGER = "3217841153FBA3E5CFFC5F57E815FCE833A813ED10F78F3C"; + string WHIRLPOOL = "EA126D6304A311602F7F194E492559FBEA4D4DC7F3E6415DE369D184E19F6597171DD1303527D8EE440A049F5239385D23E58750913FC4F94A4C5E4CDE9031D1"; + + plainText = "Lorem ipsum dolor sit amet"; + + arrayHashes = new string[] { "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512", "BLAKE2B_224", + "BLAKE2B_256", "BLAKE2B_384", "BLAKE2B_512", "BLAKE2S_128", "BLAKE2S_160", "BLAKE2S_224", "BLAKE2S_256", + "GOST3411_2012_256", "GOST3411_2012_512", "GOST3411", "KECCAK_224", "KECCAK_256", "KECCAK_288", + "KECCAK_384", "KECCAK_512", "MD2", "MD4", "RIPEMD128", "RIPEMD160", "RIPEMD256", "RIPEMD320", + "SHA3-224", "SHA3-256", "SHA3-384", "SHA3-512", "SHAKE_128", "SHAKE_256", "SM3", "TIGER", "WHIRLPOOL" }; + arrayResHashes = new string[] { MD5, SHA1, SHA224, SHA256, SHA384, SHA512, BLAKE2B_224, BLAKE2B_256, + BLAKE2B_384, BLAKE2B_512, BLAKE2S_128, BLAKE2S_160, BLAKE2S_224, BLAKE2S_256, GOST3411_2012_256, + GOST3411_2012_512, GOST3411, KECCAK_224, KECCAK_256, KECCAK_288, KECCAK_384, KECCAK_512, MD2, MD4, + RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, SHA3_224, SHA3_256, SHA3_384, SHA3_512, SHAKE_128, + SHAKE_256, SM3, TIGER, WHIRLPOOL }; + } + + [Test] + public void TestBulkHashes() + { + Hashing hash = new Hashing(); + for (int a = 0; a < arrayHashes.Length; a++) + { + string result = hash.DoHash(arrayHashes[a], plainText); + Assert.IsTrue(SecurityUtils.compareStrings(arrayResHashes[a], result)); + True(SecurityUtils.compareStrings(arrayResHashes[a], result), hash); + } + } + + + + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestCmac.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestCmac.cs new file mode 100644 index 0000000..7b27fca --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestCmac.cs @@ -0,0 +1,650 @@ +using System; +using GeneXusCryptography.Mac; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.Cryptography.Mac +{ + [TestFixture] + public class TestCmac: SecurityAPITestObject + { + private static string plainText; + private static string plainTextCTS; + + protected static string key1024; + protected static string key512; + protected static string key448; + protected static string key256; + protected static string key192; + protected static string key160; + protected static string key128; + protected static string key64; + + protected static string IV128; + protected static string IV64; + + private static SymmetricKeyGenerator keyGen; + + private static string[] encodings; + private static EncodingUtil eu; + + [SetUp] + public virtual void SetUp() + { + plainText = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet"; + plainTextCTS = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam venenatis ex sit amet risus pellentesque, a faucibus quam ultrices. Ut tincidunt quam eu aliquam maximus. Quisque posuere risus at erat blandit eleifend. Curabitur viverra rutrum volutpat. Donec quis quam tellus. Aenean fermentum elementum augue, a semper risus scelerisque sit amet. Nullam vitae sapien vitae dui ullamcorper dapibus quis quis leo. Sed neque felis, pellentesque in risus et, lobortis ultricies nulla. Quisque quis quam risus. Donec vestibulum, lectus vel vestibulum eleifend, velit ante volutpat lacus, ut mattis quam ligula eget est. Sed et pulvinar lectus. In mollis turpis non ipsum vehicula, sit amet rutrum nibh dictum. Duis consectetur convallis ex, eu ultricies enim bibendum vel. Vestibulum vel libero nibh. Morbi nec odio mattis, vestibulum quam blandit, pretium orci.Aenean pellentesque tincidunt nunc a malesuada. Etiam gravida fermentum mi, at dignissim dui aliquam quis. Nullam vel lobortis libero. Phasellus non gravida posuere"; + + keyGen = new SymmetricKeyGenerator(); + + /**** CREATE KEYS ****/ + key1024 = keyGen.doGenerateKey("GENERICRANDOM", 1024); + key512 = keyGen.doGenerateKey("GENERICRANDOM", 512); + key448 = keyGen.doGenerateKey("GENERICRANDOM", 448); + key256 = keyGen.doGenerateKey("GENERICRANDOM", 256); + key160 = keyGen.doGenerateKey("GENERICRANDOM", 160); + key192 = keyGen.doGenerateKey("GENERICRANDOM", 192); + key128 = keyGen.doGenerateKey("GENERICRANDOM", 128); + key64 = keyGen.doGenerateKey("GENERICRANDOM", 64); + + /**** CREATE IVs ****/ + IV128 = keyGen.doGenerateIV("GENERICRANDOM", 128); + IV64 = keyGen.doGenerateIV("GENERICRANDOM", 64); + + + encodings = new string[] { "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", "GB2312" }; + eu = new EncodingUtil(); + + } + + [Test] + public void TestAES() + { + // key legths 128,192 & 256 + // blocksize 128 + + testBulkAlgorithm("AES", key128, IV128, 128, false); + testBulkAlgorithm("AES", key128, IV128, 0, false); + testBulkAlgorithm("AES", key128, IV128, 64, false); + + testBulkAlgorithm("AES", key128, "", 128, false); + testBulkAlgorithm("AES", key128, "", 0, false); + testBulkAlgorithm("AES", key128, "", 64, false); + + testBulkAlgorithm("AES", key192, IV128, 128, false); + testBulkAlgorithm("AES", key192, IV128, 0, false); + testBulkAlgorithm("AES", key192, IV128, 64, false); + + testBulkAlgorithm("AES", key192, "", 128, false); + testBulkAlgorithm("AES", key192, "", 0, false); + testBulkAlgorithm("AES", key192, "", 64, false); + + testBulkAlgorithm("AES", key256, IV128, 128, false); + testBulkAlgorithm("AES", key256, IV128, 0, false); + testBulkAlgorithm("AES", key256, IV128, 64, false); + + testBulkAlgorithm("AES", key256, "", 128, false); + testBulkAlgorithm("AES", key256, "", 0, false); + testBulkAlgorithm("AES", key256, "", 64, false); + + + + } + + [Test] + public void TestBLOWFISH() + { + // key lengths 0...448 + // blocksize 64 + // no gcm + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("BLOWFISH", key128, IV64, 64, false); + testBulkAlgorithm("BLOWFISH", key128, IV64, 0, false); + + testBulkAlgorithm("BLOWFISH", key128, "", 64, false); + testBulkAlgorithm("BLOWFISH", key128, "", 0, false); + + testBulkAlgorithm("BLOWFISH", key192, IV64, 64, false); + testBulkAlgorithm("BLOWFISH", key192, IV64, 0, false); + + testBulkAlgorithm("BLOWFISH", key192, "", 64, false); + testBulkAlgorithm("BLOWFISH", key192, "", 0, false); + + testBulkAlgorithm("BLOWFISH", key256, IV64, 64, false); + testBulkAlgorithm("BLOWFISH", key256, IV64, 0, false); + + testBulkAlgorithm("BLOWFISH", key256, "", 64, false); + testBulkAlgorithm("BLOWFISH", key256, "", 0, false); + + } + + [Test] + public void TestCAMELLIA() + { + // key lengths 128.192.256 + // blocksize 128 + + testBulkAlgorithm("CAMELLIA", key128, IV128, 128, false); + testBulkAlgorithm("CAMELLIA", key128, IV128, 64, false); + testBulkAlgorithm("CAMELLIA", key128, IV128, 0, false); + + testBulkAlgorithm("CAMELLIA", key128, "", 128, false); + testBulkAlgorithm("CAMELLIA", key128, "", 64, false); + testBulkAlgorithm("CAMELLIA", key128, "", 0, false); + + testBulkAlgorithm("CAMELLIA", key192, IV128, 128, false); + testBulkAlgorithm("CAMELLIA", key192, IV128, 64, false); + testBulkAlgorithm("CAMELLIA", key192, IV128, 0, false); + + testBulkAlgorithm("CAMELLIA", key192, "", 128, false); + testBulkAlgorithm("CAMELLIA", key192, "", 64, false); + testBulkAlgorithm("CAMELLIA", key192, "", 0, false); + + testBulkAlgorithm("CAMELLIA", key256, IV128, 128, false); + testBulkAlgorithm("CAMELLIA", key256, IV128, 64, false); + testBulkAlgorithm("CAMELLIA", key256, IV128, 0, false); + + testBulkAlgorithm("CAMELLIA", key256, "", 128, false); + testBulkAlgorithm("CAMELLIA", key256, "", 64, false); + testBulkAlgorithm("CAMELLIA", key256, "", 0, false); + + + } + + [Test] + public void TestCAST5() + { + // key length 0...128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("CAST5", key64, IV64, 64, false); + testBulkAlgorithm("CAST5", key64, IV64, 0, false); + + testBulkAlgorithm("CAST5", key64, "", 64, false); + testBulkAlgorithm("CAST5", key64, "", 0, false); + + testBulkAlgorithm("CAST5", key128, IV64, 64, false); + testBulkAlgorithm("CAST5", key128, IV64, 0, false); + + testBulkAlgorithm("CAST5", key128, "", 64, false); + testBulkAlgorithm("CAST5", key128, "", 0, false); + + + } + + [Test] + public void TestCAST6() + { + // key length 0...256 + // blocksize 128 + testBulkAlgorithm("CAST6", key64, IV128, 128, false); + testBulkAlgorithm("CAST6", key64, IV128, 0, false); + testBulkAlgorithm("CAST6", key64, IV128, 64, false); + + testBulkAlgorithm("CAST6", key64, "", 128, false); + testBulkAlgorithm("CAST6", key64, "", 0, false); + testBulkAlgorithm("CAST6", key64, "", 64, false); + + testBulkAlgorithm("CAST6", key128, IV128, 128, false); + testBulkAlgorithm("CAST6", key128, IV128, 0, false); + testBulkAlgorithm("CAST6", key128, IV128, 64, false); + + testBulkAlgorithm("CAST6", key128, "", 128, false); + testBulkAlgorithm("CAST6", key128, "", 0, false); + testBulkAlgorithm("CAST6", key128, "", 64, false); + + testBulkAlgorithm("CAST6", key192, IV128, 128, false); + testBulkAlgorithm("CAST6", key192, IV128, 0, false); + testBulkAlgorithm("CAST6", key192, IV128, 64, false); + + testBulkAlgorithm("CAST6", key192, "", 128, false); + testBulkAlgorithm("CAST6", key192, "", 0, false); + testBulkAlgorithm("CAST6", key192, "", 64, false); + + testBulkAlgorithm("CAST6", key256, IV128, 128, false); + testBulkAlgorithm("CAST6", key256, IV128, 0, false); + testBulkAlgorithm("CAST6", key256, IV128, 64, false); + + testBulkAlgorithm("CAST6", key256, "", 128, false); + testBulkAlgorithm("CAST6", key256, "", 0, false); + testBulkAlgorithm("CAST6", key256, "", 64, false); + + + } + + [Test] + public void TestDES() + { + // key length 64 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX no se puede usar (keylength != 128, 192 o 256 + + testBulkAlgorithm("DES", key64, IV64, 64, false); + testBulkAlgorithm("DES", key64, IV64, 0, false); + + testBulkAlgorithm("DES", key64, "", 64, false); + testBulkAlgorithm("DES", key64, "", 0, false); + + } + + [Test] + public void TestTRIPLEDES() + { + // key length 128.192 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("TRIPLEDES", key128, IV64, 64, false); + testBulkAlgorithm("TRIPLEDES", key128, IV64, 0, false); + + testBulkAlgorithm("TRIPLEDES", key128, "", 64, false); + testBulkAlgorithm("TRIPLEDES", key128, "", 0, false); + + testBulkAlgorithm("TRIPLEDES", key192, IV64, 64, false); + testBulkAlgorithm("TRIPLEDES", key192, IV64, 0, false); + + testBulkAlgorithm("TRIPLEDES", key192, "", 64, false); + testBulkAlgorithm("TRIPLEDES", key192, "", 0, false); + + } + + [Test] + public void TestDSTU7624() + { + // key length 128, 256, 512 + // blocksize 128.256.512 + // input should be as lenght as the block + testBulkAlgorithm("DSTU7624_128", key128, IV128, 128, true); + testBulkAlgorithm("DSTU7624_128", key128, IV128, 64, true); + testBulkAlgorithm("DSTU7624_128", key128, IV128, 0, true); + + testBulkAlgorithm("DSTU7624_128", key128, "", 128, true); + testBulkAlgorithm("DSTU7624_128", key128, "", 64, true); + testBulkAlgorithm("DSTU7624_128", key128, "", 0, true); + + + } + + [Test] + public void TestGOST28147() + { + // key length 256 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("GOST28147", key256, IV64, 64, false); + testBulkAlgorithm("GOST28147", key256, IV64, 0, false); + + testBulkAlgorithm("GOST28147", key256, "", 64, false); + testBulkAlgorithm("GOST28147", key256, "", 0, false); + + } + + [Test] + public void TestNOEKEON() + { + // key length 128 + // blocksize 128 + testBulkAlgorithm("NOEKEON", key128, IV128, 128, false); + testBulkAlgorithm("NOEKEON", key128, IV128, 64, false); + testBulkAlgorithm("NOEKEON", key128, IV128, 0, false); + + + testBulkAlgorithm("NOEKEON", key128, "", 128, false); + testBulkAlgorithm("NOEKEON", key128, "", 64, false); + testBulkAlgorithm("NOEKEON", key128, "", 0, false); + } + + [Test] + public void TestRC2() + { + // key length 0...1024 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("RC2", key64, IV64, 64, false); + testBulkAlgorithm("RC2", key64, IV64, 0, false); + + testBulkAlgorithm("RC2", key64, "", 64, false); + testBulkAlgorithm("RC2", key64, "", 0, false); + + testBulkAlgorithm("RC2", key128, IV64, 64, false); + testBulkAlgorithm("RC2", key128, IV64, 0, false); + + testBulkAlgorithm("RC2", key128, "", 64, false); + testBulkAlgorithm("RC2", key128, "", 0, false); + + testBulkAlgorithm("RC2", key192, IV64, 64, false); + testBulkAlgorithm("RC2", key192, IV64, 0, false); + + testBulkAlgorithm("RC2", key192, "", 64, false); + testBulkAlgorithm("RC2", key192, "", 0, false); + + testBulkAlgorithm("RC2", key256, IV64, 64, false); + testBulkAlgorithm("RC2", key256, IV64, 0, false); + + testBulkAlgorithm("RC2", key256, "", 64, false); + testBulkAlgorithm("RC2", key256, "", 0, false); + + testBulkAlgorithm("RC2", key448, IV64, 64, false); + testBulkAlgorithm("RC2", key448, IV64, 0, false); + + testBulkAlgorithm("RC2", key448, "", 64, false); + testBulkAlgorithm("RC2", key448, "", 0, false); + + testBulkAlgorithm("RC2", key512, IV64, 64, false); + testBulkAlgorithm("RC2", key512, IV64, 0, false); + + testBulkAlgorithm("RC2", key512, "", 64, false); + testBulkAlgorithm("RC2", key512, "", 0, false); + + testBulkAlgorithm("RC2", key1024, IV64, 64, false); + testBulkAlgorithm("RC2", key1024, IV64, 0, false); + + testBulkAlgorithm("RC2", key1024, "", 64, false); + testBulkAlgorithm("RC2", key1024, "", 0, false); + + + } + + [Test] + public void TestRC532() + { + // key length 0...128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("RC532", key64, IV64, 64, false); + testBulkAlgorithm("RC532", key64, IV64, 0, false); + + testBulkAlgorithm("RC532", key64, "", 64, false); + testBulkAlgorithm("RC532", key64, "", 0, false); + + testBulkAlgorithm("RC532", key128, IV64, 64, false); + testBulkAlgorithm("RC532", key128, IV64, 0, false); + + testBulkAlgorithm("RC532", key128, "", 64, false); + testBulkAlgorithm("RC532", key128, "", 0, false); + } + + [Test] + public void TestRC6() + { + // key length 0...256 + // blocksize 128 + testBulkAlgorithm("RC6", key64, IV128, 128, false); + testBulkAlgorithm("RC6", key64, IV128, 64, false); + testBulkAlgorithm("RC6", key64, IV128, 0, false); + + testBulkAlgorithm("RC6", key64, "", 128, false); + testBulkAlgorithm("RC6", key64, "", 64, false); + testBulkAlgorithm("RC6", key64, "", 0, false); + + testBulkAlgorithm("RC6", key128, IV128, 128, false); + testBulkAlgorithm("RC6", key128, IV128, 64, false); + testBulkAlgorithm("RC6", key128, IV128, 0, false); + + testBulkAlgorithm("RC6", key128, "", 128, false); + testBulkAlgorithm("RC6", key128, "", 64, false); + testBulkAlgorithm("RC6", key128, "", 0, false); + + testBulkAlgorithm("RC6", key192, IV128, 128, false); + testBulkAlgorithm("RC6", key192, IV128, 64, false); + testBulkAlgorithm("RC6", key192, IV128, 0, false); + + testBulkAlgorithm("RC6", key192, "", 128, false); + testBulkAlgorithm("RC6", key192, "", 64, false); + testBulkAlgorithm("RC6", key192, "", 0, false); + + testBulkAlgorithm("RC6", key256, IV128, 128, false); + testBulkAlgorithm("RC6", key256, IV128, 64, false); + testBulkAlgorithm("RC6", key256, IV128, 0, false); + + testBulkAlgorithm("RC6", key256, "", 128, false); + testBulkAlgorithm("RC6", key256, "", 64, false); + testBulkAlgorithm("RC6", key256, "", 0, false); + + } + + [Test] + public void TestRIJNDAEL() + { + // key length 128.160.224.256 + // blocksize 128, 160, 192, 224, 256 + + testBulkAlgorithm("RIJNDAEL_128", key128, IV128, 128, false); + testBulkAlgorithm("RIJNDAEL_128", key128, IV128, 64, false); + testBulkAlgorithm("RIJNDAEL_128", key128, IV128, 0, false); + + testBulkAlgorithm("RIJNDAEL_128", key128, "", 128, false); + testBulkAlgorithm("RIJNDAEL_128", key128, "", 64, false); + testBulkAlgorithm("RIJNDAEL_128", key128, "", 0, false); + + testBulkAlgorithm("RIJNDAEL_128", key160, IV128, 128, false); + testBulkAlgorithm("RIJNDAEL_128", key160, IV128, 64, false); + testBulkAlgorithm("RIJNDAEL_128", key160, IV128, 0, false); + + testBulkAlgorithm("RIJNDAEL_128", key160, "", 128, false); + testBulkAlgorithm("RIJNDAEL_128", key160, "", 64, false); + testBulkAlgorithm("RIJNDAEL_128", key160, "", 0, false); + + testBulkAlgorithm("RIJNDAEL_128", key192, IV128, 128, false); + testBulkAlgorithm("RIJNDAEL_128", key192, IV128, 64, false); + testBulkAlgorithm("RIJNDAEL_128", key192, IV128, 0, false); + + testBulkAlgorithm("RIJNDAEL_128", key192, "", 128, false); + testBulkAlgorithm("RIJNDAEL_128", key192, "", 64, false); + testBulkAlgorithm("RIJNDAEL_128", key192, "", 0, false); + + testBulkAlgorithm("RIJNDAEL_128", key256, IV128, 128, false); + testBulkAlgorithm("RIJNDAEL_128", key256, IV128, 64, false); + testBulkAlgorithm("RIJNDAEL_128", key256, IV128, 0, false); + + testBulkAlgorithm("RIJNDAEL_128", key256, "", 128, false); + testBulkAlgorithm("RIJNDAEL_128", key256, "", 64, false); + testBulkAlgorithm("RIJNDAEL_128", key256, "", 0, false); + + + } + + [Test] + public void TestSEED() + { + // key length 128 + // blocksize 128 + + + testBulkAlgorithm("SEED", key128, IV128, 128, false); + testBulkAlgorithm("SEED", key128, IV128, 0, false); + testBulkAlgorithm("SEED", key128, IV128, 64, false); + + testBulkAlgorithm("SEED", key128, "", 0, false); + testBulkAlgorithm("SEED", key128, "", 128, false); + testBulkAlgorithm("SEED", key128, "", 64, false); + + } + + [Test] + public void TestSERPENT() + { + // key length 128.192.256 + // blocksize 128 + + testBulkAlgorithm("SERPENT", key128, IV128, 128, false); + testBulkAlgorithm("SERPENT", key128, IV128, 0, false); + testBulkAlgorithm("SERPENT", key128, IV128, 64, false); + + testBulkAlgorithm("SERPENT", key128, "", 128, false); + testBulkAlgorithm("SERPENT", key128, "", 0, false); + testBulkAlgorithm("SERPENT", key128, "", 64, false); + + testBulkAlgorithm("SERPENT", key192, IV128, 128, false); + testBulkAlgorithm("SERPENT", key192, IV128, 0, false); + testBulkAlgorithm("SERPENT", key192, IV128, 64, false); + + testBulkAlgorithm("SERPENT", key192, "", 128, false); + testBulkAlgorithm("SERPENT", key192, "", 0, false); + testBulkAlgorithm("SERPENT", key192, "", 64, false); + + testBulkAlgorithm("SERPENT", key256, IV128, 128, false); + testBulkAlgorithm("SERPENT", key256, IV128, 0, false); + testBulkAlgorithm("SERPENT", key256, IV128, 64, false); + + testBulkAlgorithm("SERPENT", key256, "", 128, false); + testBulkAlgorithm("SERPENT", key256, "", 0, false); + testBulkAlgorithm("SERPENT", key256, "", 64, false); + + } + + [Test] + public void TestSKIPJACK() + { + // key length 128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("SKIPJACK", key128, IV64, 64, false); + testBulkAlgorithm("SKIPJACK", key128, IV64, 0, false); + + testBulkAlgorithm("SKIPJACK", key128, "", 64, false); + testBulkAlgorithm("SKIPJACK", key128, "", 0, false); + + } + + [Test] + public void TestSM4() + { + // key length 128 + // blocksize 128 + testBulkAlgorithm("SM4", key128, IV128, 128, false); + testBulkAlgorithm("SM4", key128, IV128, 0, false); + testBulkAlgorithm("SM4", key128, IV128, 64, false); + + testBulkAlgorithm("SM4", key128, "", 128, false); + testBulkAlgorithm("SM4", key128, "", 0, false); + testBulkAlgorithm("SM4", key128, "", 64, false); + + } + + [Test] + public void TestTEA() + { + // key length 128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("TEA", key128, IV64, 64, false); + testBulkAlgorithm("TEA", key128, IV64, 0, false); + + testBulkAlgorithm("TEA", key128, "", 64, false); + testBulkAlgorithm("TEA", key128, "", 0, false); + + } + + [Test] + public void TestTWOFISH() + { + // key length 128.192.256 + // blocksize 128 + testBulkAlgorithm("TWOFISH", key128, IV128, 128, false); + testBulkAlgorithm("TWOFISH", key128, IV128, 0, false); + testBulkAlgorithm("TWOFISH", key128, IV128, 64, false); + + testBulkAlgorithm("TWOFISH", key128, "", 128, false); + testBulkAlgorithm("TWOFISH", key128, "", 0, false); + testBulkAlgorithm("TWOFISH", key128, "", 64, false); + + + testBulkAlgorithm("TWOFISH", key192, IV128, 128, false); + testBulkAlgorithm("TWOFISH", key192, IV128, 0, false); + testBulkAlgorithm("TWOFISH", key192, IV128, 64, false); + + testBulkAlgorithm("TWOFISH", key192, "", 128, false); + testBulkAlgorithm("TWOFISH", key192, "", 0, false); + testBulkAlgorithm("TWOFISH", key192, "", 64, false); + + testBulkAlgorithm("TWOFISH", key256, IV128, 128, false); + testBulkAlgorithm("TWOFISH", key256, IV128, 0, false); + testBulkAlgorithm("TWOFISH", key256, IV128, 64, false); + + testBulkAlgorithm("TWOFISH", key256, "", 128, false); + testBulkAlgorithm("TWOFISH", key256, "", 0, false); + testBulkAlgorithm("TWOFISH", key256, "", 64, false); + + + } + + [Test] + public void TestXTEA() + { + // key length 128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("XTEA", key128, IV64, 64, false); + testBulkAlgorithm("XTEA", key128, IV64, 0, false); + + testBulkAlgorithm("XTEA", key128, "", 64, false); + testBulkAlgorithm("XTEA", key128, "", 0, false); + + + } + + + private void testBulkAlgorithm(string algorithm, string key, string IV, int macSize, bool cts) + { + for (int i = 0; i < encodings.Length; i++) + { + eu.setEncoding(encodings[i]); + if (cts) + { + testBulkAlgorithmCTS(algorithm, key, IV, macSize, plainTextCTS); + } + else + { + testBulkAlgorithmCTS(algorithm, key, IV, macSize, plainText); + } + } + } + + private void testBulkAlgorithmCTS(string algorithm, string key, string IV, int macSize, string input) + { + + Cmac mac = new Cmac(); + string res = mac.calculate(input, key, algorithm, macSize); + bool verified = mac.verify(input, key, res, algorithm, macSize); + //System.out.println("res: "+res); + /*if(mac.hasError()) + { + System.out.println("Eror. Code: "+mac.getErrorCode()+" Desc: "+mac.getErrorDescription()); + }else { + System.out.println("no error"); + }*/ + Assert.IsTrue(verified); + True(true, mac); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestHmac.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestHmac.cs new file mode 100644 index 0000000..a78b7fb --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Mac/TestHmac.cs @@ -0,0 +1,114 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Keys; +using GeneXusCryptography.Mac; +using SecurityAPICommons.Utils; + +namespace SecurityAPITest.Cryptography.Mac +{ + [TestFixture] + public class TestHmac: SecurityAPITestObject + { + + protected static string plainText; + protected string[] arrayHashes; + protected static string password; + protected static string passUTF8; + protected string[] arrayResHashes; + + private static string[] encodings; + private static EncodingUtil eu; + + [SetUp] + public virtual void SetUp() + { + SymmetricKeyGenerator keyGen = new SymmetricKeyGenerator(); + password = keyGen.doGenerateKey("GENERICRANDOM", 128); + passUTF8 = "64887e525dce27351f5cb5ce85615e52"; + plainText = "Lorem ipsum dolor sit amet"; + arrayHashes = new string[] { "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512", "BLAKE2B_224", + "BLAKE2B_256", "BLAKE2B_384", "BLAKE2B_512", "BLAKE2S_128", "BLAKE2S_160", "BLAKE2S_224", "BLAKE2S_256", + "GOST3411_2012_256", "GOST3411_2012_512", "GOST3411", "KECCAK_224", "KECCAK_256", "KECCAK_288", + "KECCAK_384", "KECCAK_512", "MD2", "MD4", "RIPEMD128", "RIPEMD160", "RIPEMD256", "RIPEMD320", + "SHA3-224", "SHA3-256", "SHA3-384", "SHA3-512", "SHAKE_128", "SHAKE_256", "SM3", "TIGER", "WHIRLPOOL" }; + + encodings = new string[] { "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", + "GB2312" }; + + eu = new EncodingUtil(); + + string MD5 = "41A5B12FFE84175A2982A8D500B1EBAF"; + string SHA1 = "50D4AE631960E8D040FBEC617EF442B7AB251221"; + string SHA224 = "F441D15E93F2BAA1B5379A5F16B878307A21D5BEDCB61A987F01CE61"; + string SHA256 = "6B0E8EB91ED3EAE87A0AD4E1293F8FC50C2C297E4FAEC07AA43AB47E49CB7B1F"; + string SHA384 = "04C3B9B5A874D95749D6134073FB27C2B4E02D701BC5A2B5D3A0CCC345EA66B8D3C57036977DE686CBFBFFEEC2398218"; + string SHA512 = "E9A2125DBA53A4227DE74855526BA4816C6B45B5D001318C3D069D2DF94359A93099F6CDBC14710D8D3B5B956037192B44EEF8C32DE32E3AF59D24BDFC3E5DAF"; + string BLAKE2B_224 = "26CF9B1A316F1FD854DF19163C7B8C142618254DA200A20635E1D698"; + string BLAKE2B_256 = "9F78D7ACAFDA844CADD4F57817E1A368776A7D783B61BC95D174097BAC9E12BC"; + string BLAKE2B_384 = "2E2205934FB1057E3A347958180170FCE5F4DFA5ACC7623EA79BD6BC9CDAC2E57A192A77E2B9B0FE87D24BAB5BDDEEF2"; + string BLAKE2B_512 = "453EBB12652903F1C0DB44A86CF4D8DE8BD10BBDDCAE20C62ABFA16B3F7F289E10D69AAE6BEACEEEDD4CB4C42B1181C2964B95B7AE18A342605E969536A21B47"; + string BLAKE2S_128 = "9FF71F18EB2D3A9E21D5F7CD17BCF5C9"; + string BLAKE2S_160 = "CE919197A9207946EEC7DEDD2DA8F0CFCE3D10B8"; + string BLAKE2S_224 = "4CFE71196DAEAB298B31362BB2B908C667C2395DB45E717328093F21"; + string BLAKE2S_256 = "B4272BFA822369C40A3FA584739755E47F2EEE3D1A109CA010773B79883E5581"; + string GOST3411_2012_256 = "4BB2AC559E3A163BDFEC294339DE624AA90CFA5E91812477FCF43EC8692EA8E9"; + string GOST3411_2012_512 = "B96ABD6DCAB30DF76777B214AD243EC5C9349D5017A2D2F196499757AE31EAC121C72ADC457081BBF6B0763E9AE32472B7D85F1E1342B3104E5F2934F2DC83A0"; + string GOST3411 = "CA0BCB7E5C49CDFA68F2D0B53F52670626C3EDEABEA8335CBC7ED1FDFC8200D8"; + string KECCAK_224 = "1FE172D71F537B6F83B23E24E744C5E880E25F0051DCEC3B1F678327"; + string KECCAK_256 = "BFDFB4872184A37996A6A8544A3ABB84C1968D46F89E0839B3BDF7C8E87C2E4F"; + string KECCAK_288 = "6C49617278C34213B98CB90510ADD1346DEF8D0FB90B0F693553E0FFB41CB5D425C5A2EF"; + string KECCAK_384 = "B37946F7370758D7656B8D48DD9704B1AECBB4A2C58CBA0DD4B1FC730EACC9D42CCE666FD216A5238C127D4552CEA6D7"; + string KECCAK_512 = "0CCBD557A60DA24082FF20EA8A1987516BBDA2ACAD23DAA27C47F20082BA940A8D7B298C08395180A56DA5E68E90BBCC4A56B1C51431BF9AAB1A10B72BC988D4"; + string MD2 = "4F13A1C9AE27F3EF6D824DF30A1E2290"; + string MD4 = "8FB02C3DFC1E5F570BBDDDAF844D74F2"; + string RIPEMD128 = "AE3231A70E15B56FB15FE6947BACF32B"; + string RIPEMD160 = "BB7AC728783394986A6085DE3CA4CABA1B16B35B"; + string RIPEMD256 = "C0AA36C7D7A5F4C9ADA1A33976DEB7D8E61A55D5B6378F023A011A92AEFB8FC7"; + string RIPEMD320 = "34DABB9D5E807F77309A59289B7F339CB824C963DF66EBCEF56E3499630D86B2E31E0AC98C50EED4"; + string SHA3_224 = "621437AB69507712BC89DDB9128E1DF19894357AAB3637557CAD39B9"; + string SHA3_256 = "3B19CB71223B73C8B8BE4E9CAE8FDF9FDCFB53B0CE8788749F5EBDD186C90620"; + string SHA3_384 = "C3682F9296438F8A6F83599FB9F37F40C8EAC20A63B3F3E889C34982CD5B22FEEF5B1B23816B5047303C4BB953F68B57"; + string SHA3_512 = "0B9BD9EB8D6A6F7A2E64FAD66798250B5007CEC289BB6354973D02BD1BA94F4FF6C4561E75781D784FD0620515D67BD084956542CE80D7B6E49FE06E8CB755B5"; + string SHAKE_128 = "F08CC5D7EA62097A1B180F2902CD287B"; + string SHAKE_256 = "D760B7E606CD64BBEDACA6B36F3F2D9EE0D9EBD84B5CC195999AB549CDE60914"; + string SM3 = "8F447ED2CF879D5001CAE681041DE38326C55B948846168997D3C304AEA32D6D"; + string TIGER = "FEF8448095FC19DFCE2E6B6CAE8BA594D3DC358E910473B2"; + string WHIRLPOOL = "594BDF03B876331E3642685A497DDEC69894403422ABCB6ADE0E77999DA030027EA613027E0E18A3D42190110DEBE75357412EB7567EEF9C7CB170BCCFC3E7EC"; + + arrayResHashes = new string[] { MD5, SHA1, SHA224, SHA256, SHA384, SHA512, BLAKE2B_224, BLAKE2B_256, + BLAKE2B_384, BLAKE2B_512, BLAKE2S_128, BLAKE2S_160, BLAKE2S_224, BLAKE2S_256, GOST3411_2012_256, + GOST3411_2012_512, GOST3411, KECCAK_224, KECCAK_256, KECCAK_288, KECCAK_384, KECCAK_512, MD2, MD4, + RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, SHA3_224, SHA3_256, SHA3_384, SHA3_512, SHAKE_128, + SHAKE_256, SM3, TIGER, WHIRLPOOL }; + + } + + [Test] + public void TestBulkMacs() + { + for (int i = 0; i < encodings.Length; i++) + { + eu.setEncoding(encodings[i]); + Hmac mac = new Hmac(); + for (int a = 0; a < arrayHashes.Length; a++) + { + if (SecurityUtils.compareStrings(encodings[i], "UTF_8")) + { + string res = mac.calculate(plainText, passUTF8, arrayHashes[a]); + Assert.IsTrue(SecurityUtils.compareStrings(res, arrayResHashes[a])); + True(true, mac); + } + string result = mac.calculate(plainText, password, arrayHashes[a]); + Assert.IsTrue(mac.verify(plainText, password, result, arrayHashes[a])); + True(true, mac); + } + } + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/PasswordDerivation/TestPasswordDerivation.cs b/test/dotnetframework/SecurityAPITest/Cryptography/PasswordDerivation/TestPasswordDerivation.cs new file mode 100644 index 0000000..a87fa90 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/PasswordDerivation/TestPasswordDerivation.cs @@ -0,0 +1,127 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Commons; +using SecurityAPICommons.Encoders; +using GeneXusCryptography.PasswordDerivation; + +namespace SecurityAPITest.Cryptography.PasswordDerivationTest +{ + [TestFixture] + public class TestPasswordDerivation: SecurityAPITestObject + { + protected static string password; + protected static Error error; + protected static HexaEncoder hexa; + protected static PasswordDerivation pd; + + /* SCRYPT */ + + protected static string saltScrypt; + protected static int N; + protected static int r; + protected static int p; + protected static int keyLenght; + protected static string expectedScrypt; + + /* BCRYPT */ + protected static int cost; + protected static string saltBcrypt; + protected static string expectedBcrypt; + + /* ARGON2 */ + protected static int iterations; + protected static int parallelism; + protected static int memory; + protected static int hashLength; + protected static string saltArgon2; + protected static string[] argon2Version; + protected static string[] argon2HashType; + protected static string[] argon2Results; + + [SetUp] + public virtual void SetUp() + { + new EncodingUtil().setEncoding("UTF8"); + password = "password"; + error = new Error(); + hexa = new HexaEncoder(); + pd = new PasswordDerivation(); + + /* SCRYPT */ + N = 16384; + r = 8; + p = 1; + keyLenght = 256; + saltScrypt = "123456"; + expectedScrypt = "Yc4uLDXRam2HNQxFdEJWkNYADNWgelNIidOmFE8G3G9G9j6/l/fXP43ErypBMZGs+6PLVPBPRop2pHWWIhUg4hXDoM8+fsp10wBoV3p06yxxdZu7LV19gcgwgL2tnMTN/H8Y7YYM9KpFwdFqMXbIX4DPN2hrL6DAXxNIYJO7Pcm1l9qPrOwpsZZjE032nYlXch6t8/4HRxWFOFRl8t5UjtILEyFdg1w3kLlYzP46XJV1IqGEMyFjeQbtz/c7MteZmID0aSxLtoZJPF3TA41vs09hLlhG/AoMiVQ+EXsp3vZZzg7t4RNrWfuLd2H+oFEqeEUNUisUoB8IWmyAZgn2QQ=="; + /* BCRYPT */ + cost = 6; + saltBcrypt = "0c6a8a8235bb90219d004aa4056ec884"; + expectedBcrypt = "XoHha7SLqyY2AKgIIetMdjYBM5bizqPc"; + /* ARGON2 */ + iterations = 1; + parallelism = 2; + memory = 4; + hashLength = 32; + saltArgon2 = "14ae8da01afea8700c2358dcef7c5358d9021282bd88663a4562f59fb74d22ee"; + argon2Version = new string[] { "ARGON2_VERSION_10", "ARGON2_VERSION_13" }; + argon2HashType = new string[] { "ARGON2_d", "ARGON2_i", "ARGON2_id" }; + argon2Results = new string[] { "f9hF4rzwC9AvfFMK8ZHvKoQeipc7OUQ/dBV4nBer57U=", "QuNCd8sy8STFTBeylfaUVWAN8w3PDl0L94rr9TqaK/g=", "El6fozCF2xSzdcrfR0QO8U1Zmh4OuRZPwufAvqXcLiY=", "xvlSYizqgM93gmi7cTDvkXda41QDj6fTaCC2cpltt3E=", "jDKqkLzOaxFQ2vHwB3/UQiSI2wO+2cDk6Y1VQwSXzz4=", "A8icyy1A7VlunnJKBZXJl/BkNmVQ5FlMznCNKS1YJCM=" }; + + } + + [Test] + public void TestScrypt() + { + string derivated = pd.DoGenerateSCrypt(password, saltScrypt, N, r, p, keyLenght); + Assert.AreEqual(expectedScrypt, derivated); + Equals(expectedScrypt, derivated, pd); + } + + [Test] + public void TestDefaultScrypt() + { + string derivated = pd.DoGenerateDefaultSCrypt(password, saltScrypt); + Assert.AreEqual(expectedScrypt, derivated); + Equals(expectedScrypt, derivated, pd); + } + + [Test] + public void TestBcrypt() + { + string derivated = pd.DoGenerateBcrypt(password, saltBcrypt, cost); + Assert.AreEqual(expectedBcrypt, derivated); + Equals(expectedBcrypt, derivated, pd); + } + + [Test] + public void TestDefaultBcrypt() + { + string derivated = pd.DoGenerateDefaultBcrypt(password, saltBcrypt); + Assert.AreEqual(expectedBcrypt, derivated); + Equals(expectedBcrypt, derivated, pd); + } + + + [Test] + public void TestArgon2() + { + /*int i = 0; + foreach (string version in argon2Version) + { + foreach (string hashType in argon2HashType) + { + string derivated = pd.doGenerateArgon2(version, hashType, iterations, memory, parallelism, password, saltArgon2, hashLength); + Assert.AreEqual(argon2Results[i], derivated); + Equals(argon2Results[i], derivated, pd); + i++; + } + }*/ + //*****ALGORITHM NOT IMPLEMENTED IN C#*****// + Assert.IsTrue(true); + + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestBlockEncryption.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestBlockEncryption.cs new file mode 100644 index 0000000..a374023 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestBlockEncryption.cs @@ -0,0 +1,660 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Config; +using GeneXusCryptography.Symmetric; +using SecurityAPICommons.Utils; + +namespace SecurityAPITest.Cryptography.Symmetric +{ + [TestFixture] + public class TestBlockEncryption: SecurityAPITestObject + { + private static string plainText; + private static string plainTextCTS; + private static string[] arrayPaddings; + private static string[] arrayModes; + private static string[] arrayModes64; + private static string[] arrayNoncesCCM; + private static string[] arrayNonces; + private static int[] arrayTagsGCM; + private static int[] arrayMacsEAX; + private static int[] arrayTagsCCM; + + protected static string key1024; + protected static string key512; + protected static string key448; + protected static string key256; + protected static string key192; + protected static string key160; + protected static string key128; + protected static string key64; + + protected static string IV1024; + protected static string IV512; + protected static string IV256; + protected static string IV224; + protected static string IV192; + protected static string IV160; + protected static string IV128; + protected static string IV64; + + private static SymmetricKeyGenerator keyGen; + + private static string[] encodings; + private static EncodingUtil eu; + + [SetUp] + protected virtual void SetUp() + { + + // new EncodingUtil().setEncoding("UTF8"); + plainText = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet"; + plainTextCTS = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam venenatis ex sit amet risus pellentesque, a faucibus quam ultrices. Ut tincidunt quam eu aliquam maximus. Quisque posuere risus at erat blandit eleifend. Curabitur viverra rutrum volutpat. Donec quis quam tellus. Aenean fermentum elementum augue, a semper risus scelerisque sit amet. Nullam vitae sapien vitae dui ullamcorper dapibus quis quis leo. Sed neque felis, pellentesque in risus et, lobortis ultricies nulla. Quisque quis quam risus. Donec vestibulum, lectus vel vestibulum eleifend, velit ante volutpat lacus, ut mattis quam ligula eget est. Sed et pulvinar lectus. In mollis turpis non ipsum vehicula, sit amet rutrum nibh dictum. Duis consectetur convallis ex, eu ultricies enim bibendum vel. Vestibulum vel libero nibh. Morbi nec odio mattis, vestibulum quam blandit, pretium orci.Aenean pellentesque tincidunt nunc a malesuada. Etiam gravida fermentum mi, at dignissim dui aliquam quis. Nullam vel lobortis libero. Phasellus non gravida posuere"; + + keyGen = new SymmetricKeyGenerator(); + + /**** CREATE KEYS ****/ + key1024 = keyGen.doGenerateKey("GENERICRANDOM", 1024); + key512 = keyGen.doGenerateKey("GENERICRANDOM", 512); + key448 = keyGen.doGenerateKey("GENERICRANDOM", 448); + key256 = keyGen.doGenerateKey("GENERICRANDOM", 256); + key160 = keyGen.doGenerateKey("GENERICRANDOM", 160); + key192 = keyGen.doGenerateKey("GENERICRANDOM", 192); + key128 = keyGen.doGenerateKey("GENERICRANDOM", 128); + key64 = keyGen.doGenerateKey("GENERICRANDOM", 64); + + /**** CREATE IVs ****/ + IV1024 = keyGen.doGenerateIV("GENERICRANDOM", 1024); + IV512 = keyGen.doGenerateIV("GENERICRANDOM", 512); + IV256 = keyGen.doGenerateIV("GENERICRANDOM", 256); + IV224 = keyGen.doGenerateIV("GENERICRANDOM", 224); + IV192 = keyGen.doGenerateIV("GENERICRANDOM", 192); + IV160 = keyGen.doGenerateIV("GENERICRANDOM", 160); + IV128 = keyGen.doGenerateIV("GENERICRANDOM", 128); + IV64 = keyGen.doGenerateIV("GENERICRANDOM", 64); + + /**** CREATE nonces ****/ + string nonce104 = keyGen.doGenerateIV("GENERICRANDOM", 104); + string nonce64 = keyGen.doGenerateIV("GENERICRANDOM", 64); + string nonce56 = keyGen.doGenerateIV("GENERICRANDOM", 56); + arrayNoncesCCM = new string[] { nonce56, nonce64, nonce104 }; + + /**** CREATE PADDINGS ****/ + arrayPaddings = new string[] { "PKCS7PADDING", "ISO10126D2PADDING", "X923PADDING", "ISO7816D4PADDING", + "ZEROBYTEPADDING" }; + + /**** CREATEMODES ****/ + arrayModes = new string[] { "ECB", "CBC", "CFB", "CTR", "CTS", "OFB", "OPENPGPCFB" }; + arrayModes64 = new string[] { "ECB", "CBC", "CFB", "CTR", "CTS", "OFB", "OPENPGPCFB", "GCTR" }; + arrayTagsGCM = new int[] { 128, 120, 112, 104, 96 }; + arrayTagsCCM = new int[] { 64, 128 }; + arrayMacsEAX = new int[] { 8, 16, 64, 128 }; + arrayNonces = new string[] { IV64, IV128, IV192, IV256 }; + + encodings = new string[] { "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", + "GB2312" }; + + eu = new EncodingUtil(); + } + + [Test] + public void TestAES() + { + // key legths 128,192 & 256 + // blocksize 128 + + testBulkAlgorithm("AES", arrayModes, arrayPaddings, key128, IV128, false); + testBulkAlgorithm("AES", arrayModes, arrayPaddings, key192, IV128, false); + testBulkAlgorithm("AES", arrayModes, arrayPaddings, key256, IV128, false); + // testCCM(string algorithm, string key, int macSize, boolean cts) { + // testGCM(string algorithm, string key, string nonce, boolean cts) { + // testEAX(string algorithm, string key, string nonce, boolean cts) { + testCCM("AES", key128, false); + testCCM("AES", key192, false); + testCCM("AES", key256, false); + + testGCM("AES", key128, false); + testGCM("AES", key192, false); + testGCM("AES", key256, false); + + testEAX("AES", key128, false); + testEAX("AES", key192, false); + testEAX("AES", key256, false); + + } + + [Test] + public void TestBLOWFISH() + { + // key lengths 0...448 + // blocksize 64 + // no gcm + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("BLOWFISH", arrayModes64, arrayPaddings, key128, IV64, false); + testBulkAlgorithm("BLOWFISH", arrayModes64, arrayPaddings, key192, IV64, false); + testBulkAlgorithm("BLOWFISH", arrayModes64, arrayPaddings, key256, IV64, false); + testBulkAlgorithm("BLOWFISH", arrayModes64, arrayPaddings, key448, IV64, false); + + } + + [Test] + public void TestCAMELLIA() + { + // key lengths 128.192.256 + // blocksize 128 + + testBulkAlgorithm("CAMELLIA", arrayModes, arrayPaddings, key128, IV128, false); + testBulkAlgorithm("CAMELLIA", arrayModes, arrayPaddings, key192, IV128, false); + testBulkAlgorithm("CAMELLIA", arrayModes, arrayPaddings, key256, IV128, false); + + // testCCM(string algorithm, string key, int macSize, boolean cts) { + // testGCM(string algorithm, string key, string nonce, boolean cts) { + // testEAX(string algorithm, string key, string nonce, boolean cts) { + + testCCM("CAMELLIA", key128, false); + testCCM("CAMELLIA", key192, false); + testCCM("CAMELLIA", key256, false); + + testGCM("CAMELLIA", key128, false); + testGCM("CAMELLIA", key192, false); + testGCM("CAMELLIA", key256, false); + + testEAX("CAMELLIA", key128, false); + testEAX("CAMELLIA", key192, false); + testEAX("CAMELLIA", key256, false); + + } + + [Test] + public void TestCAST5() + { + // key length 0...128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("CAST5", arrayModes64, arrayPaddings, key64, IV64, false); + testBulkAlgorithm("CAST5", arrayModes64, arrayPaddings, key128, IV64, false); + + } + + [Test] + public void TestCAST6() + { + // key length 0...256 + // blocksize 128 + testBulkAlgorithm("CAST6", arrayModes, arrayPaddings, key64, IV128, false); + testBulkAlgorithm("CAST6", arrayModes, arrayPaddings, key128, IV128, false); + testBulkAlgorithm("CAST6", arrayModes, arrayPaddings, key192, IV128, false); + testBulkAlgorithm("CAST6", arrayModes, arrayPaddings, key256, IV128, false); + + // testCCM(string algorithm, string key, int macSize, boolean cts) { + // testGCM(string algorithm, string key, string nonce, boolean cts) { + // testEAX(string algorithm, string key, string nonce, boolean cts) { + + testCCM("CAST6", key64, false); + testCCM("CAST6", key128, false); + testCCM("CAST6", key192, false); + testCCM("CAST6", key256, false); + + testGCM("CAST6", key64, false); + testGCM("CAST6", key128, false); + testGCM("CAST6", key192, false); + testGCM("CAST6", key256, false); + + testEAX("CAST6", key128, false); + testEAX("CAST6", key192, false); + testEAX("CAST6", key256, false); + + } + + [Test] + public void TestDES() + { + // key length 64 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX no se puede usar (keylength != 128, 192 o 256 + + testBulkAlgorithm("DES", arrayModes64, arrayPaddings, key64, IV64, false); + + } + + [Test] + public void TestTRIPLEDES() + { + // key length 128.192 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("TRIPLEDES", arrayModes64, arrayPaddings, key128, IV64, false); + testBulkAlgorithm("TRIPLEDES", arrayModes64, arrayPaddings, key192, IV64, false); + + } + + [Test] + public void TestDSTU7624() + { + // key length 128, 256, 512 + // blocksize 128.256.512 + // input should be as lenght as the block + testBulkAlgorithm("DSTU7624_128", arrayModes, arrayPaddings, key128, IV128, true); + testBulkAlgorithm("DSTU7624_256", arrayModes, arrayPaddings, key256, IV256, true); + testBulkAlgorithm("DSTU7624_512", arrayModes, arrayPaddings, key512, IV512, true); + + // testCCM(string algorithm, string key, int macSize, boolean cts) { + // testGCM(string algorithm, string key, string nonce, boolean cts) { + // testEAX(string algorithm, string key, string nonce, boolean cts) { + + testCCM("DSTU7624_128", key128, true); + + testGCM("DSTU7624_128", key128, true); + + testEAX("DSTU7624_128", key128, true); + + } + + [Test] + public void TestGOST28147() + { + // key length 256 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("GOST28147", arrayModes64, arrayPaddings, key256, IV64, false); + + } + + [Test] + public void TestNOEKEON() + { + // key length 128 + // blocksize 128 + testBulkAlgorithm("NOEKEON", arrayModes, arrayPaddings, key128, IV128, false); + + testCCM("NOEKEON", key128, false); + testGCM("NOEKEON", key128, false); + testEAX("NOEKEON", key128, false); + + } + + [Test] + public void TestRC2() + { + // key length 0...1024 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("RC2", arrayModes64, arrayPaddings, key64, IV64, false); + testBulkAlgorithm("RC2", arrayModes64, arrayPaddings, key128, IV64, false); + testBulkAlgorithm("RC2", arrayModes64, arrayPaddings, key192, IV64, false); + testBulkAlgorithm("RC2", arrayModes64, arrayPaddings, key256, IV64, false); + testBulkAlgorithm("RC2", arrayModes64, arrayPaddings, key512, IV64, false); + testBulkAlgorithm("RC2", arrayModes64, arrayPaddings, key1024, IV64, false); + + } + + [Test] + public void TestRC532() + { + // key length 0...128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("RC532", arrayModes64, arrayPaddings, key64, IV64, false); + testBulkAlgorithm("RC532", arrayModes64, arrayPaddings, key128, IV64, false); + } + + [Test] + public void TestRC6() + { + // key length 0...256 + // blocksize 128 + testBulkAlgorithm("RC6", arrayModes, arrayPaddings, key64, IV128, false); + testBulkAlgorithm("RC6", arrayModes, arrayPaddings, key128, IV128, false); + testBulkAlgorithm("RC6", arrayModes, arrayPaddings, key192, IV128, false); + testBulkAlgorithm("RC6", arrayModes, arrayPaddings, key256, IV128, false); + + testCCM("RC6", key64, false); + testCCM("RC6", key128, false); + testCCM("RC6", key192, false); + testCCM("RC6", key256, false); + + testGCM("RC6", key64, false); + testGCM("RC6", key128, false); + testGCM("RC6", key192, false); + testGCM("RC6", key256, false); + + testEAX("RC6", key128, false); + testEAX("RC6", key192, false); + testEAX("RC6", key256, false); + } + + [Test] + public void TestRIJNDAEL() + { + // key length 128.160.224.256 + // blocksize 128, 160, 192, 224, 256 + + testBulkAlgorithm("RIJNDAEL_128", arrayModes, arrayPaddings, key128, IV128, false); + testBulkAlgorithm("RIJNDAEL_128", arrayModes, arrayPaddings, key160, IV128, false); + testBulkAlgorithm("RIJNDAEL_128", arrayModes, arrayPaddings, key192, IV128, false); + testBulkAlgorithm("RIJNDAEL_128", arrayModes, arrayPaddings, key256, IV128, false); + + testBulkAlgorithm("RIJNDAEL_160", arrayModes, arrayPaddings, key128, IV160, false); + testBulkAlgorithm("RIJNDAEL_160", arrayModes, arrayPaddings, key160, IV160, false); + testBulkAlgorithm("RIJNDAEL_160", arrayModes, arrayPaddings, key192, IV160, false); + testBulkAlgorithm("RIJNDAEL_160", arrayModes, arrayPaddings, key256, IV160, false); + + testBulkAlgorithm("RIJNDAEL_192", arrayModes, arrayPaddings, key128, IV192, false); + testBulkAlgorithm("RIJNDAEL_192", arrayModes, arrayPaddings, key160, IV192, false); + testBulkAlgorithm("RIJNDAEL_192", arrayModes, arrayPaddings, key192, IV192, false); + testBulkAlgorithm("RIJNDAEL_192", arrayModes, arrayPaddings, key256, IV192, false); + + testBulkAlgorithm("RIJNDAEL_224", arrayModes, arrayPaddings, key128, IV224, false); + testBulkAlgorithm("RIJNDAEL_224", arrayModes, arrayPaddings, key160, IV224, false); + testBulkAlgorithm("RIJNDAEL_224", arrayModes, arrayPaddings, key192, IV224, false); + testBulkAlgorithm("RIJNDAEL_224", arrayModes, arrayPaddings, key256, IV224, false); + + testBulkAlgorithm("RIJNDAEL_256", arrayModes, arrayPaddings, key128, IV256, false); + testBulkAlgorithm("RIJNDAEL_256", arrayModes, arrayPaddings, key160, IV256, false); + testBulkAlgorithm("RIJNDAEL_256", arrayModes, arrayPaddings, key192, IV256, false); + testBulkAlgorithm("RIJNDAEL_256", arrayModes, arrayPaddings, key256, IV256, false); + + testCCM("RIJNDAEL_128", key128, false); + testCCM("RIJNDAEL_128", key160, false); + testCCM("RIJNDAEL_128", key192, false); + testCCM("RIJNDAEL_128", key256, false); + + testGCM("RIJNDAEL_128", key128, false); + testGCM("RIJNDAEL_128", key160, false); + testGCM("RIJNDAEL_128", key192, false); + testGCM("RIJNDAEL_128", key256, false); + + testEAX("RIJNDAEL_128", key128, false); + testEAX("RIJNDAEL_128", key192, false); + testEAX("RIJNDAEL_128", key256, false); + + } + + [Test] + public void TestSEED() + { + // key length 128 + // blocksize 128 + + testBulkAlgorithm("SEED", arrayModes, arrayPaddings, key128, IV128, false); + + testCCM("SEED", key128, false); + testGCM("SEED", key128, false); + testEAX("SEED", key128, false); + } + + [Test] + public void TestSERPENT() + { + // key length 128.192.256 + // blocksize 128 + testBulkAlgorithm("SERPENT", arrayModes, arrayPaddings, key128, IV128, false); + testBulkAlgorithm("SERPENT", arrayModes, arrayPaddings, key192, IV128, false); + testBulkAlgorithm("SERPENT", arrayModes, arrayPaddings, key256, IV128, false); + + testCCM("SERPENT", key128, false); + testCCM("SERPENT", key192, false); + testCCM("SERPENT", key256, false); + + testGCM("SERPENT", key128, false); + testGCM("SERPENT", key192, false); + testGCM("SERPENT", key256, false); + + testEAX("SERPENT", key128, false); + testEAX("SERPENT", key192, false); + testEAX("SERPENT", key256, false); + + } + + [Test] + public void TestSKIPJACK() + { + // key length 128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("SKIPJACK", arrayModes64, arrayPaddings, key128, IV64, false); + + } + + [Test] + public void TestSM4() + { + // key length 128 + // blocksize 128 + testBulkAlgorithm("SM4", arrayModes, arrayPaddings, key128, IV128, false); + + testCCM("SM4", key128, false); + testGCM("SM4", key128, false); + testEAX("SM4", key128, false); + } + + [Test] + public void TestTEA() + { + // key length 128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("TEA", arrayModes64, arrayPaddings, key128, IV64, false); + + } + + [Test] + public void TestTHREEFISH() + { + // key length 256.512.1024 + // blocksize 256.512.1024 + // key must be same size as the block + // the input must be the same length or longer than the block + // no se puede usar CCM (blosize!=128) + // GCM siempre explota + + testBulkAlgorithm("THREEFISH_256", arrayModes, arrayPaddings, key256, IV256, true); + testBulkAlgorithm("THREEFISH_512", arrayModes, arrayPaddings, key512, IV512, true); + testBulkAlgorithm("THREEFISH_1024", arrayModes, arrayPaddings, key1024, IV1024, true); + } + + [Test] + public void TestTWOFISH() + { + // key length 128.192.256 + // blocksize 128 + testBulkAlgorithm("TWOFISH", arrayModes, arrayPaddings, key128, IV128, false); + testBulkAlgorithm("TWOFISH", arrayModes, arrayPaddings, key192, IV128, false); + testBulkAlgorithm("TWOFISH", arrayModes, arrayPaddings, key256, IV128, false); + + testCCM("TWOFISH", key128, false); + testCCM("TWOFISH", key192, false); + testCCM("TWOFISH", key256, false); + + testGCM("TWOFISH", key128, false); + testGCM("TWOFISH", key192, false); + testGCM("TWOFISH", key256, false); + + testEAX("TWOFISH", key128, false); + testEAX("TWOFISH", key192, false); + testEAX("TWOFISH", key256, false); + + } + + [Test] + public void TestXTEA() + { + // key length 128 + // blocksize 64 + // no se puede usar CCM (blosize!=128) + // no se pude usar GCM (blocksize <128) + // EAX siempre explota, no se puede usar con AEAD + + testBulkAlgorithm("XTEA", arrayModes64, arrayPaddings, key128, IV64, false); + + } + + + + private void testBulkAlgorithm(string algorithm, string[] modes, string[] paddings, string key, string IV, + bool cts) + { + for (int i = 0; i < encodings.Length; i++) + { + eu.setEncoding(encodings[i]); + if (cts) + { + testBulkAlgorithmCTS(algorithm, modes, paddings, key, IV, plainTextCTS); + } + else + { + testBulkAlgorithmCTS(algorithm, modes, paddings, key, IV, plainText); + } + } + } + + private void testBulkAlgorithmCTS(string algorithm, string[] modes, string[] paddings, string key, string IV, + string text) + { + for (int m = 0; m < arrayModes.Length; m++) + { + for (int p = 0; p < arrayPaddings.Length; p++) + { + SymmetricBlockCipher symBlockCipher = new SymmetricBlockCipher(); + string encrypted = symBlockCipher.DoEncrypt(algorithm, arrayModes[m], arrayPaddings[p], key, IV, text); + string decrypted = symBlockCipher.DoDecrypt(algorithm, arrayModes[m], arrayPaddings[p], key, IV, + encrypted); + + /*eu.setEncoding("UTF_16"); + string encrypted = symBlockCipher.DoEncrypt(algorithm, arrayModes[2], arrayPaddings[0], key, IV, text); + string decrypted = symBlockCipher.DoDecrypt(algorithm, arrayModes[2], arrayPaddings[0], key, IV, + encrypted); + string encoding = eu.getEncoding();*/ + string resText = eu.getString(eu.getBytes(text)); + Assert.IsTrue(SecurityUtils.compareStrings(resText, decrypted)); + + True(true, symBlockCipher); + } + + } + } + + private void testCCM(string algorithm, string key, bool cts) + { + if (cts) + { + testCCM_CTS(algorithm, key, plainTextCTS); + } + else + { + testCCM_CTS(algorithm, key, plainText); + } + } + + private void testCCM_CTS(string algorithm, string key, string text) + { + for (int n = 0; n < arrayNoncesCCM.Length; n++) + { + for (int t = 0; t < arrayTagsCCM.Length; t++) + { + for (int p = 0; p < arrayPaddings.Length; p++) + { + SymmetricBlockCipher symBlockCipher = new SymmetricBlockCipher(); + string encrypted = symBlockCipher.DoAEADEncrypt(algorithm, "AEAD_CCM", key, arrayTagsCCM[t], + arrayNoncesCCM[n], text); + string decrypted = symBlockCipher.DoAEADDecrypt(algorithm, "AEAD_CCM", key, arrayTagsCCM[t], + arrayNoncesCCM[n], encrypted); + Assert.IsTrue(SecurityUtils.compareStrings(text, decrypted)); + True(SecurityUtils.compareStrings(text, decrypted), symBlockCipher); + } + } + } + } + + private void testEAX(string algorithm, string key, bool cts) + { + if (cts) + { + testEAX_CTS(algorithm, key, plainTextCTS); + } + else + { + testEAX_CTS(algorithm, key, plainText); + } + } + + private void testEAX_CTS(string algorithm, string key, string text) + { + for (int m = 0; m < arrayMacsEAX.Length; m++) + { + for (int n = 0; n < arrayNonces.Length; n++) + { + for (int p = 0; p < arrayPaddings.Length; p++) + { + SymmetricBlockCipher symBlockCipher = new SymmetricBlockCipher(); + string encrypted = symBlockCipher.DoAEADEncrypt(algorithm, "AEAD_EAX", key, arrayMacsEAX[m], + arrayNonces[n], text); + string decrypted = symBlockCipher.DoAEADDecrypt(algorithm, "AEAD_EAX", key, arrayMacsEAX[m], + arrayNonces[n], encrypted); + Assert.IsTrue(SecurityUtils.compareStrings(text, decrypted)); + True(SecurityUtils.compareStrings(text, decrypted), symBlockCipher); + } + } + } + } + + private void testGCM(string algorithm, string key, bool cts) + { + if (cts) + { + testGCM_CTS(algorithm, key, plainTextCTS); + } + else + { + testGCM_CTS(algorithm, key, plainText); + } + } + + private void testGCM_CTS(string algorithm, string key, string text) + { + for (int m = 0; m < arrayTagsGCM.Length; m++) + { + for (int n = 0; n < arrayNonces.Length; n++) + { + for (int p = 0; p < arrayPaddings.Length; p++) + { + SymmetricBlockCipher symBlockCipher = new SymmetricBlockCipher(); + string encrypted = symBlockCipher.DoAEADEncrypt(algorithm, "AEAD_GCM", key, arrayTagsGCM[m], + arrayNonces[n], text); + string decrypted = symBlockCipher.DoAEADDecrypt(algorithm, "AEAD_GCM", key, arrayTagsGCM[m], + arrayNonces[n], encrypted); + Assert.IsTrue(SecurityUtils.compareStrings(text, decrypted)); + True(SecurityUtils.compareStrings(text, decrypted), symBlockCipher); + } + } + } + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestStreamEncryption.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestStreamEncryption.cs new file mode 100644 index 0000000..29c007d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestStreamEncryption.cs @@ -0,0 +1,156 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using SecurityAPICommons.Config; +using SecurityAPICommons.Keys; +using GeneXusCryptography.Symmetric; +using SecurityAPICommons.Utils; + +namespace SecurityAPITest.Cryptography.Symmetric +{ + [TestFixture] + public class TestStreamEncryption: SecurityAPITestObject + { + protected static string key8; + protected static string key32; + protected static string key128; + protected static string key256; + protected static string key1024; + protected static string key6144; + protected static string key8192; + + protected static string IV64; + protected static string IV128; + protected static string IV192; + protected static string IV256; + protected static string IV512; + protected static string IV1024; + protected static string IV6144; + + private static string plainText; + + private static string[] encodings; + private static EncodingUtil eu; + + [SetUp] + public virtual void SetUp() + { + + plainText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam venenatis ex sit amet risus pellentesque, a faucibus quam ultrices. Ut tincidunt quam eu aliquam maximus. Quisque posuere risus at erat blandit eleifend. Curabitur viverra rutrum volutpat. Donec quis quam tellus. Aenean fermentum elementum augue, a semper risus scelerisque sit amet. Nullam vitae sapien vitae dui ullamcorper dapibus quis quis leo. Sed neque felis, pellentesque in risus et, lobortis ultricies nulla. Quisque quis quam risus. Donec vestibulum, lectus vel vestibulum eleifend, velit ante volutpat lacus, ut mattis quam ligula eget est. Sed et pulvinar lectus. In mollis turpis non ipsum vehicula, sit amet rutrum nibh dictum. Duis consectetur convallis ex, eu ultricies enim bibendum vel. Vestibulum vel libero nibh. Morbi nec odio mattis, vestibulum quam blandit, pretium orci.Aenean pellentesque tincidunt nunc a malesuada. Etiam gravida fermentum mi, at dignissim dui aliquam quis. Nullam vel lobortis libero. Phasellus non gravida posuere"; + SymmetricKeyGenerator keyGen = new SymmetricKeyGenerator(); + + /**** GENERATE KEYS ****/ + key8 = keyGen.doGenerateKey("GENERICRANDOM", 8); + key32 = keyGen.doGenerateKey("GENERICRANDOM", 32); + key128 = keyGen.doGenerateKey("GENERICRANDOM", 128); + key256 = keyGen.doGenerateKey("GENERICRANDOM", 256); + key1024 = keyGen.doGenerateKey("GENERICRANDOM", 1024); + key8192 = keyGen.doGenerateKey("GENERICRANDOM", 8192); + key6144 = keyGen.doGenerateKey("GENERICRANDOM", 6144); + + /**** GENERATE IVs ****/ + IV64 = keyGen.doGenerateIV("GENERICRANDOM", 64); + IV128 = keyGen.doGenerateIV("GENERICRANDOM", 128); + IV192 = keyGen.doGenerateIV("GENERICRANDOM", 192); + IV256 = keyGen.doGenerateIV("GENERICRANDOM", 256); + IV512 = keyGen.doGenerateIV("GENERICRANDOM", 512); + IV1024 = keyGen.doGenerateIV("GENERICRANDOM", 1024); + IV6144 = keyGen.doGenerateIV("GENERICRANDOM", 6144); + + encodings = new string[] { "UTF_8", "UTF_16", "UTF_16BE", "UTF_16LE", "UTF_32", "UTF_32BE", "UTF_32LE", "SJIS", + "GB2312" }; + + eu = new EncodingUtil(); + + } + + [Test] + public void TestRC4() + { + // RC4 key 1024, no nonce + testBulkAlgorithms("RC4", key1024, ""); + } + + [Test] + public void TestHC128() + { + // HC128 key 128 bits, no nonce + testBulkAlgorithms("HC128", key128, IV128); + } + + [Test] + public void TestHC256() + { + // HC256 key 256 bits, IV 128 o 256 bits + testBulkAlgorithms("HC256", key256, IV128); + testBulkAlgorithms("HC256", key256, IV256); + + } + + [Test] + public void TestSALSA20() + { + // SALSA20 key 256 o 128 bits, 64 bit nonce + testBulkAlgorithms("SALSA20", key128, IV64); + testBulkAlgorithms("SALSA20", key256, IV64); + + } + + [Test] + public void TestCHACHA20() + { + // CHACHA key 128 o 256, IV 64 bits + testBulkAlgorithms("CHACHA20", key128, IV64); + testBulkAlgorithms("CHACHA20", key256, IV64); + } + + [Test] + public void TestXSALSA20() + { + // SALSA20 key 256 bits, 192 bit nonce + testBulkAlgorithms("XSALSA20", key256, IV192); + } + + [Test] + public void TestISAAC() + { + // ISAAC 32, 8192 key, no nonce + testBulkAlgorithms("ISAAC", key32, ""); + testBulkAlgorithms("ISAAC", key8192, ""); + } + + [Test] + public void TestVMPC() + { + // key 8 o 6144, nonce 1...6144 bits + testBulkAlgorithms("VMPC", key8, IV64); + testBulkAlgorithms("VMPC", key8, IV128); + testBulkAlgorithms("VMPC", key8, IV192); + testBulkAlgorithms("VMPC", key8, IV256); + testBulkAlgorithms("VMPC", key8, IV512); + testBulkAlgorithms("VMPC", key8, IV1024); + testBulkAlgorithms("VMPC", key8, IV6144); + + testBulkAlgorithms("VMPC", key6144, IV64); + testBulkAlgorithms("VMPC", key6144, IV128); + testBulkAlgorithms("VMPC", key6144, IV192); + testBulkAlgorithms("VMPC", key6144, IV256); + testBulkAlgorithms("VMPC", key6144, IV512); + testBulkAlgorithms("VMPC", key6144, IV1024); + testBulkAlgorithms("VMPC", key6144, IV6144); + + } + + private void testBulkAlgorithms(string algorithm, string key, string IV) + { + for (int i = 0; i < encodings.Length; i++) + { + eu.setEncoding(encodings[i]); + SymmetricStreamCipher symCipher = new SymmetricStreamCipher(); + string encrypted = symCipher.DoEncrypt(algorithm, key, IV, plainText); + string decrypted = symCipher.DoDecrypt(algorithm, key, IV, encrypted); + Assert.IsTrue(SecurityUtils.compareStrings(plainText, decrypted)); + True(SecurityUtils.compareStrings(plainText, decrypted), symCipher); + } + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestSymmetricDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestSymmetricDomainSpaces.cs new file mode 100644 index 0000000..2ed31d1 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Cryptography/Symmetric/TestSymmetricDomainSpaces.cs @@ -0,0 +1,58 @@ +using GeneXusCryptography.Symmetric; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.Cryptography.Symmetric +{ + [TestFixture] + public class TestSymmetricDomainSpaces : SecurityAPITestObject + { + private static string plainText; + private static SymmetricKeyGenerator keyGen; + private static string key128; + private static string IV128; + private static SymmetricBlockCipher symBlockCipher; + + private static string plainTextStream; + private static string key1024; + private static SymmetricStreamCipher symStreamCipher; + + [SetUp] + public virtual void SetUp() + { + plainText = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet"; + keyGen = new SymmetricKeyGenerator(); + + key128 = keyGen.doGenerateKey(" GENERICRANDOM", 128); + IV128 = keyGen.doGenerateIV("GENERICRANDOM ", 128); + symBlockCipher = new SymmetricBlockCipher(); + + plainTextStream = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam venenatis ex sit amet risus pellentesque, a faucibus quam ultrices. Ut tincidunt quam eu aliquam maximus. Quisque posuere risus at erat blandit eleifend. Curabitur viverra rutrum volutpat. Donec quis quam tellus. Aenean fermentum elementum augue, a semper risus scelerisque sit amet. Nullam vitae sapien vitae dui ullamcorper dapibus quis quis leo. Sed neque felis, pellentesque in risus et, lobortis ultricies nulla. Quisque quis quam risus. Donec vestibulum, lectus vel vestibulum eleifend, velit ante volutpat lacus, ut mattis quam ligula eget est. Sed et pulvinar lectus. In mollis turpis non ipsum vehicula, sit amet rutrum nibh dictum. Duis consectetur convallis ex, eu ultricies enim bibendum vel. Vestibulum vel libero nibh. Morbi nec odio mattis, vestibulum quam blandit, pretium orci.Aenean pellentesque tincidunt nunc a malesuada. Etiam gravida fermentum mi, at dignissim dui aliquam quis. Nullam vel lobortis libero. Phasellus non gravida posuere"; + key1024 = keyGen.doGenerateKey("GENERICRANDOM ", 1024); + symStreamCipher = new SymmetricStreamCipher(); + + } + + [Test] + public void TestBlockDomains() + { + string encrypted = symBlockCipher.DoEncrypt("AES ", "CBC ", "ZEROBYTEPADDING ", key128, IV128, plainText); + Assert.IsFalse(symBlockCipher.HasError()); + string decrypted = symBlockCipher.DoDecrypt(" AES", " CBC", " ZEROBYTEPADDING", key128, IV128, encrypted); + Assert.IsFalse(symBlockCipher.HasError()); + Assert.IsTrue(SecurityUtils.compareStrings(decrypted, plainText)); + } + + [Test] + public void TestStreamDomains() + { + string encrypted = symStreamCipher.DoEncrypt("RC4 ", key1024, "", plainTextStream); + Assert.IsFalse(symStreamCipher.HasError()); + string decrypted = symStreamCipher.DoDecrypt(" RC4", key1024, "", encrypted); + Assert.IsFalse(symStreamCipher.HasError()); + Assert.IsTrue(SecurityUtils.compareStrings(decrypted, plainTextStream)); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs b/test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs new file mode 100644 index 0000000..e987b7a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs @@ -0,0 +1,138 @@ +using GeneXusFtps.GeneXusFtps; +using NUnit.Framework; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; +using System.IO; + +namespace SecurityAPITest.Ftps +{ + [TestFixture] + public class TestFtps: SecurityAPITestObject + { + protected static string host; + protected static string user; + protected static string password; + protected static string localPath; + protected static string remoteDir; + protected static string remoteFilePath; + protected static string localDir; + protected static string pwd; + protected static int port; + protected static string connectionMode; + protected static bool forceEncryption; + protected static string encoding; + protected static string encryptionMode; + protected static string protocol; + protected static string trustStorePath; + protected static string trustStorePassword; + protected static ExtensionsWhiteList whiteList; + protected static string imagePath; + + [SetUp] + public virtual void SetUp() + { + host = TestContextParameter("gx_ftp_host"); + user = TestContextParameter("gx_ftps_user"); + password = TestContextParameter("gx_ftps_password"); + localPath = Path.Combine(BASE_PATH, "Temp", "ftps", "ftpstest.txt"); + remoteDir = "/files"; + remoteFilePath = "/files/ftpstest.txt"; + localDir = Path.Combine(BASE_PATH, "Temp", "ftps", "back"); + port = 21; + connectionMode = "PASSIVE"; + forceEncryption = true; + encoding = "BINARY"; + encryptionMode = "EXPLICIT"; + protocol = "TLS1_2"; + string certificateConentBase64 = TestContextParameter("gx_ftp_certificate_content_base64"); + trustStorePath = Path.Combine(BASE_PATH, "Temp", "ftps", "ftps_cert.pfx"); + File.WriteAllBytes(trustStorePath, System.Convert.FromBase64String(certificateConentBase64)); + trustStorePassword = TestContextParameter("gx_ftps_trust_store_password"); + whiteList = new ExtensionsWhiteList(); + whiteList.SetExtension(".txt"); + whiteList.SetExtension(".pdf"); + imagePath = Path.Combine(BASE_PATH, "Temp", "icon.png"); + } + + private FtpsClient TestConnection(FtpsOptions options) + { + FtpsClient client = new FtpsClient(); + bool connected = client.Connect(options); + True(connected, client); + return client; + } + + private void TestPut(FtpsClient client) + { + bool put = client.Put(localPath, remoteDir); + True(put, client); + } + + private void TestGet(FtpsClient client) + { + bool get = client.Get(remoteFilePath, localDir); + True(get, client); + } + + [Test] + public void TestWithoutCert() + { + FtpsOptions options = new FtpsOptions(); + options.Host = host; + options.User = user; + options.Password = password; + options.Port = port; + options.ForceEncryption = forceEncryption; + options.ConnectionMode = connectionMode; + options.EncryptionMode = encryptionMode; + options.Protocol = protocol; + options.WhiteList = whiteList; + FtpsClient client = TestConnection(options); + TestPut(client); + TestGet(client); + client.Disconnect(); + } + + [Test] + public void TestWithCert() + { + FtpsOptions options = new FtpsOptions(); + options.Host = host; + options.User = user; + options.Password = password; + options.Port = port; + options.ForceEncryption = forceEncryption; + options.ConnectionMode = connectionMode; + options.EncryptionMode = encryptionMode; + options.Protocol = protocol; + options.WhiteList = whiteList; + options.TrustStorePath = trustStorePath; + options.TrustStorePassword = trustStorePassword; + FtpsClient client = TestConnection(options); + TestPut(client); + TestGet(client); + client.Disconnect(); + } + + [Test] + public void TestWhiteList() + { + FtpsOptions options = new FtpsOptions(); + options.Host = host; + options.User = user; + options.Password = password; + options.Port = port; + options.ForceEncryption = forceEncryption; + options.ConnectionMode = connectionMode; + options.EncryptionMode = encryptionMode; + options.Protocol = protocol; + options.WhiteList = whiteList; + FtpsClient client = TestConnection(options); + bool put = client.Put(imagePath, remoteDir); + Assert.IsFalse(put); + Assert.IsTrue(client.HasError()); + client.Disconnect(); + + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs new file mode 100644 index 0000000..518db19 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs @@ -0,0 +1,82 @@ +using GeneXusFtps.GeneXusFtps; +using NUnit.Framework; +using SecurityAPITest.SecurityAPICommons.commons; +using System.IO; + +namespace SecurityAPITest.Ftps +{ + [TestFixture] + public class TestFtpsDomainSpaces : SecurityAPITestObject + { + protected static string host; + protected static string user; + protected static string password; + protected static string localPath; + protected static string remoteDir; + protected static string remoteFilePath; + protected static string localDir; + protected static string pwd; + protected static int port; + protected static string connectionMode; + protected static bool forceEncryption; + protected static string encoding; + protected static string encryptionMode; + protected static string protocol; + + [SetUp] + public virtual void SetUp() + { + host = TestContextParameter("gx_ftp_host"); + user = TestContextParameter("gx_ftps_user"); + password = TestContextParameter("gx_ftps_password"); + localPath = Path.Combine(BASE_PATH, "Temp", "ftps", "ftpstest.txt"); + remoteDir = "/files"; + remoteFilePath = "/files/ftpstest.txt"; + localDir = Path.Combine(BASE_PATH, "Temp", "ftps", "back"); + port = 21; + connectionMode = "PASSIVE "; + forceEncryption = true; + encoding = " BINARY"; + encryptionMode = " EXPLICIT"; + protocol = "TLS1_2 "; + } + + private FtpsClient TestConnection(FtpsOptions options) + { + FtpsClient client = new FtpsClient(); + bool connected = client.Connect(options); + True(connected, client); + return client; + } + + private void TestPut(FtpsClient client) + { + bool put = client.Put(localPath, remoteDir); + True(put, client); + } + + private void TestGet(FtpsClient client) + { + bool get = client.Get(remoteFilePath, localDir); + True(get, client); + } + + [Test] + public void TestSFtpsSpaces() + { + FtpsOptions options = new FtpsOptions(); + options.Host = host; + options.User = user; + options.Password = password; + options.Port = port; + options.ForceEncryption = forceEncryption; + options.ConnectionMode = connectionMode; + options.EncryptionMode = encryptionMode; + options.Protocol = protocol; + FtpsClient client = TestConnection(options); + TestPut(client); + TestGet(client); + client.Disconnect(); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestAsymmetricJwt.cs b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestAsymmetricJwt.cs new file mode 100644 index 0000000..173e78d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestAsymmetricJwt.cs @@ -0,0 +1,279 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusJWTUtils; +using GeneXusJWT.GenexusJWTClaims; +using System; +using System.IO; + +namespace SecurityAPITest.Jwt.Asymmetric +{ + [TestFixture] + public class TestAsymmetricJwt: SecurityAPITestObject + { + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static GUID guid; + protected static DateUtil du; + protected static SymmetricKeyGenerator keyGenerator; + protected static JWTCreator jwt; + + protected static string path_RSA_sha256_1024; + protected static string path_RSA_sha256_2048; + protected static string path_RSA_sha512_2048; + protected static string path_EC; + + protected static string alias; + protected static string password; + + [SetUp] + public virtual void SetUp() + { + + du = new DateUtil(); + guid = new GUID(); + keyGenerator = new SymmetricKeyGenerator(); + jwt = new JWTCreator(); + options = new JWTOptions(); + claims = new PrivateClaims(); + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + + options.AddRegisteredClaim("jti", guid.Generate()); + + options.AddCustomTimeValidationClaim("exp", du.CurrentPlusSeconds(100), "20"); + options.AddCustomTimeValidationClaim("iat", du.GetCurrentDate(), "20"); + options.AddCustomTimeValidationClaim("nbf", du.GetCurrentDate(), "20"); + + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + + path_RSA_sha256_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_1024"); + path_RSA_sha256_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_2048"); + path_RSA_sha512_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha512_2048"); + path_EC = Path.Combine(BASE_PATH, "dummycerts", "JWT_ECDSA", "prime_test"); + + alias = "1"; + password = "dummy"; + + } + + [Test] + public void Test_sha256_1024_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha256_1024_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + + + [Test] + public void Test_sha256_1024_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.LoadPKCS12(pathKey, alias, password); + cert.LoadPKCS12(pathCert, alias, password); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha256_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha256_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + + + [Test] + public void Test_sha256_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.LoadPKCS12(pathKey, alias, password); + cert.LoadPKCS12(pathCert, alias, password); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha512_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "RS512"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha512_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "RS512"; + bulkTest(key, cert, alg); + } + + + + [Test] + public void Test_sha512_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.LoadPKCS12(pathKey, alias, password); + cert.LoadPKCS12(pathCert, alias, password); + string alg = "RS512"; + bulkTest(key, cert, alg); + } + + /*[Test] + public void Test_sha256_EC() + { + string pathKey = Path.Combine(path_EC, "key.pem"); + string pathCert = Path.Combine(path_EC, "cert_sha256.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha384_EC() + { + string pathKey = Path.Combine(path_EC, "key.pem"); + string pathCert = Path.Combine(path_EC, "cert_sha384.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES384"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha512_EC() + { + string pathKey = Path.Combine(path_EC, "key.pem"); + string pathCert = Path.Combine(path_EC, "cert_sha512.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES512"; + bulkTest(key, cert, alg); + }*/ + + + + private void bulkTest(PrivateKeyManager key, CertificateX509 cert, string alg) + { + options.SetPrivateKey(key); + options.SetCertificate(cert); + string token = jwt.DoCreate(alg, claims, options); + Assert.IsFalse(jwt.HasError()); + //bool verification = jwt.DoVerify(token, alg, claims, options); + //True(verification, jwt); + } + + [Test] + public void Test_sha512_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.LoadEncrypted(pathKey, password); + cert.Load(pathCert); + string alg = "RS512"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha256_1024_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.LoadEncrypted(pathKey, password); + cert.Load(pathCert); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + [Test] + public void Test_sha256_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.LoadEncrypted(pathKey, password); + cert.Load(pathCert); + string alg = "RS256"; + bulkTest(key, cert, alg); + } + + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestCreateWithoutCert.cs b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestCreateWithoutCert.cs new file mode 100644 index 0000000..799db18 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestCreateWithoutCert.cs @@ -0,0 +1,61 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SecurityAPITest.Jwt.Asymmetric +{ + [TestFixture] + public class TestCreateWithoutCert: SecurityAPITestObject + { + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static SymmetricKeyGenerator keyGenerator; + protected static JWTCreator jwt; + + protected static string path_RSA_sha256_1024; + + [SetUp] + public virtual void SetUp() + { + + + keyGenerator = new SymmetricKeyGenerator(); + jwt = new JWTCreator(); + options = new JWTOptions(); + claims = new PrivateClaims(); + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + + path_RSA_sha256_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_1024"); + + } + + [Test] + public void Test_sha256_1024_PEM() + { + String pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + key.Load(pathKey); + options.SetPrivateKey(key); + String alg = "RS256"; + String token = jwt.DoCreate(alg, claims, options); + Assert.IsFalse(SecurityUtils.compareStrings("", token)); + Assert.IsFalse(jwt.HasError()); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesPrimeJwt.cs b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesPrimeJwt.cs new file mode 100644 index 0000000..5a125be --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesPrimeJwt.cs @@ -0,0 +1,197 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWTUtils; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; +using System.IO; + +namespace SecurityAPITest.Jwt.Asymmetric +{ + [TestFixture] + public class TestECDSACurvesPrimeJwt: SecurityAPITestObject + { + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static GUID guid; + protected static JWTCreator jwt; + protected static string ECDSA_path; + + [SetUp] + public virtual void SetUp() + { + guid = new GUID(); + jwt = new JWTCreator(); + options = new JWTOptions(); + claims = new PrivateClaims(); + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + + options.AddRegisteredClaim("jti", guid.Generate()); + + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + + ECDSA_path = Path.Combine(BASE_PATH, "dummycerts", "JWT_ECDSA"); + } + + private void bulkTest_shouldWork(PrivateKeyManager key, CertificateX509 cert, string alg, string curve) + { + options.SetPrivateKey(key); + options.SetCertificate(cert); + string token = jwt.DoCreate(alg, claims, options); + Assert.IsFalse(jwt.HasError()); + bool verification = jwt.DoVerify(token, alg, claims, options); + True(verification, jwt); + } + + private void bulkTest_shouldntWork(PrivateKeyManager key, CertificateX509 cert, string alg, string curve) + { + options.SetPrivateKey(key); + options.SetCertificate(cert); + string token = jwt.DoCreate(alg, claims, options); + Assert.IsTrue(jwt.HasError()); + } + + public void test_shouldWork() + { + + prime192v1(); + prime192v2(); + prime192v3(); + prime239v1(); + prime239v2(); + prime239v3(); + prime256v1(); + } + + + [Test] + public void prime192v1() + { + string pathKey = Path.Combine(ECDSA_path, "prime192v1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "prime192v1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "prime192v1"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + + + } + + [Test] + public void prime192v2() + { + string pathKey = Path.Combine(ECDSA_path, "prime192v2", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "prime192v2", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "prime192v2"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + } + + [Test] + public void prime192v3() + { + string pathKey = Path.Combine(ECDSA_path, "prime192v3", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "prime192v3", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "prime192v3"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + } + + [Test] + public void prime239v1() + { + string pathKey = Path.Combine(ECDSA_path, "prime239v1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "prime239v1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "prime239v1"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + } + + [Test] + public void prime239v2() + { + string pathKey = Path.Combine(ECDSA_path, "prime239v2", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "prime239v2", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "prime239v2"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + } + + [Test] + public void prime239v3() + { + string pathKey = Path.Combine(ECDSA_path, "prime239v3", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "prime239v3", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "prime239v3"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + } + + [Test] + public void prime256v1() + { + string pathKey = Path.Combine(ECDSA_path, "prime256v1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "prime256v1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "prime256v1"; + bulkTest_shouldWork(key, cert, alg, curve); + } + + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSecpJwt.cs b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSecpJwt.cs new file mode 100644 index 0000000..205841a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSecpJwt.cs @@ -0,0 +1,278 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWTUtils; +using NUnit.Framework; +using SecurityAPICommons.Commons; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SecurityAPITest.Jwt.Asymmetric +{ + [TestFixture] + public class TestECDSACurvesSecpJwt: SecurityAPITestObject + { + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static GUID guid; + protected static JWTCreator jwt; + protected static string ECDSA_path; + + [SetUp] + public virtual void SetUp() + { + guid = new GUID(); + jwt = new JWTCreator(); + options = new JWTOptions(); + claims = new PrivateClaims(); + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + + options.AddRegisteredClaim("jti", guid.Generate()); + + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + + ECDSA_path = Path.Combine(BASE_PATH, "dummycerts", "JWT_ECDSA"); + } + + private void bulkTest_shouldWork(PrivateKeyManager key, CertificateX509 cert, string alg, string curve) + { + options.SetPrivateKey(key); + options.SetCertificate(cert); + string token = jwt.DoCreate(alg, claims, options); + Assert.IsFalse(jwt.HasError()); + bool verification = jwt.DoVerify(token, alg, claims, options); + True(verification, jwt); + } + + private void bulkTest_shouldntWork(PrivateKeyManager key, CertificateX509 cert, string alg, string curve) + { + options.SetPrivateKey(key); + options.SetCertificate(cert); + string token = jwt.DoCreate(alg, claims, options); + Assert.IsTrue(jwt.HasError()); + } + + public void test_shouldWork() + { + + secp192k1(); + secp256k1(); + secp384r1(); + secp521r1(); + + } + + public void test_shouldntWork() + { + secp112r1(); + secp112r2(); + secp128r1(); + secp128r2(); + secp160k1(); + secp160r1(); + /***ESTOS DOS FUNCIONAN A VECES SI Y A VECES NO***/ + //secp224k1(); + //secp224r1(); + secp160r2(); + + } + + [Test] + public void secp112r1() + { + string pathKey = Path.Combine(ECDSA_path, "secp112r1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp112r1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp112r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void secp112r2() + { + string pathKey = Path.Combine(ECDSA_path, "secp112r2", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp112r2", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp112r2"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void secp128r1() + { + string pathKey = Path.Combine(ECDSA_path, "secp128r1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp128r1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp128r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void secp128r2() + { + string pathKey = Path.Combine(ECDSA_path, "secp128r2", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp128r2", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp128r2"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void secp160k1() + { + string pathKey = Path.Combine(ECDSA_path, "secp160k1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp160k1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp160k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void secp160r1() + { + string pathKey = Path.Combine(ECDSA_path, "secp160r1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp160r1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp160r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void secp160r2() + { + string pathKey = Path.Combine(ECDSA_path, "secp160r2", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp160r2", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp160r2"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void secp192k1() + { + string pathKey = Path.Combine(ECDSA_path, "secp192k1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp192k1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp192k1"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + } + + /*private void secp224k1() { + string pathKey = Path.Combine(ECDSA_path, "secp224k1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp224k1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp224k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + + }*/ + + /*private void secp224r1() { + string pathKey = Path.Combine(ECDSA_path, "secp224r1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp224r1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp224r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + }*/ + + [Test] + public void secp256k1() + { + string pathKey = Path.Combine(ECDSA_path, "secp256k1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp256k1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp256k1"; +#if NETCORE + bulkTest_shouldntWork(key, cert, alg, curve); +#else + bulkTest_shouldWork(key, cert, alg, curve); +#endif + + } + + [Test] + public void secp384r1() + { + string pathKey = Path.Combine(ECDSA_path, "secp384r1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp384r1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp384r1"; + bulkTest_shouldWork(key, cert, alg, curve); + } + + [Test] + public void secp521r1() + { + string pathKey = Path.Combine(ECDSA_path, "secp521r1", "key.pem"); + string pathCert = Path.Combine(ECDSA_path, "secp521r1", "cert.pem"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "secp521r1"; + bulkTest_shouldWork(key, cert, alg, curve); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSectJwt.cs b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSectJwt.cs new file mode 100644 index 0000000..a5ae49b --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Asymmetric/TestECDSACurvesSectJwt.cs @@ -0,0 +1,347 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWTUtils; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SecurityAPITest.Jwt.Asymmetric +{ + [TestFixture] + public class TestECDSACurvesSectJwt: SecurityAPITestObject + { + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static GUID guid; + protected static JWTCreator jwt; + protected static string ECDSA_path; + + [SetUp] + public virtual void SetUp() + { + guid = new GUID(); + jwt = new JWTCreator(); + options = new JWTOptions(); + claims = new PrivateClaims(); + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + + options.AddRegisteredClaim("jti", guid.Generate()); + + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + + ECDSA_path = Path.Combine(BASE_PATH, "dummycerts", "JWT_ECDSA"); + } + + + private void bulkTest_shouldWork(PrivateKeyManager key, CertificateX509 cert, string alg, string curve) + { + options.SetPrivateKey(key); + options.SetCertificate(cert); + string token = jwt.DoCreate(alg, claims, options); + Assert.IsFalse(jwt.HasError()); + bool verification = jwt.DoVerify(token, alg, claims, options); + True(verification, jwt); + } + + private void bulkTest_shouldntWork(PrivateKeyManager key, CertificateX509 cert, string alg, string curve) + { + options.SetPrivateKey(key); + options.SetCertificate(cert); + string token = jwt.DoCreate(alg, claims, options); + Assert.IsTrue(jwt.HasError()); + } + + /*public void test_shouldWork() + { + + + + + }*/ + + public void test_shouldntWork() + { + sect113r1(); + sect113r2(); + sect131r1(); + sect131r2(); + sect163k1(); + sect163r1(); + sect163r2(); + sect193r1(); + sect193r2(); + sect233k1(); + /***ANDA CUANDO QUIERE***/ + // sect233r1(); + sect283k1(); + sect283r1(); + sect409k1(); + sect409r1(); + sect571k1(); + sect571r1(); + sect239k1(); +} + + + [Test] + public void sect113r1() + { + string pathKey = ECDSA_path + "sect113r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect113r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect113r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect113r2() + { + string pathKey = ECDSA_path + "sect113r2" + "\\key.pem"; + string pathCert = ECDSA_path + "sect113r2" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect113r2"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect131r1() + { + string pathKey = ECDSA_path + "sect131r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect131r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect131r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect131r2() + { + string pathKey = ECDSA_path + "sect131r2" + "\\key.pem"; + string pathCert = ECDSA_path + "sect131r2" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect131r2"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect163k1() + { + string pathKey = ECDSA_path + "sect163k1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect163k1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect163k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect163r1() + { + string pathKey = ECDSA_path + "sect163r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect163r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect163r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect163r2() + { + string pathKey = ECDSA_path + "sect163r2" + "\\key.pem"; + string pathCert = ECDSA_path + "sect163r2" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect163r2"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect193r1() + { + string pathKey = ECDSA_path + "sect193r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect193r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect193r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect193r2() + { + string pathKey = ECDSA_path + "sect193r2" + "\\key.pem"; + string pathCert = ECDSA_path + "sect193r2" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect193r2"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect233k1() + { + string pathKey = ECDSA_path + "sect233k1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect233k1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect233k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + /*private void sect233r1() { + string pathKey = ECDSA_path + "sect233r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect233r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect233r1"; + bulkTest_shouldWork(key, cert, alg, curve); + }*/ + + [Test] + public void sect239k1() + { + string pathKey = ECDSA_path + "sect239k1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect239k1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect239k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect283k1() + { + string pathKey = ECDSA_path + "sect283k1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect283k1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect283k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect283r1() + { + string pathKey = ECDSA_path + "sect283r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect283r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect283r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect409k1() + { + string pathKey = ECDSA_path + "sect409k1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect409k1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect409k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect409r1() + { + string pathKey = ECDSA_path + "sect409r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect409r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect409r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect571k1() + { + string pathKey = ECDSA_path + "sect571k1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect571k1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect571k1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + + [Test] + public void sect571r1() + { + string pathKey = ECDSA_path + "sect571r1" + "\\key.pem"; + string pathCert = ECDSA_path + "sect571r1" + "\\cert.pem"; + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + string alg = "ES256"; + string curve = "sect571r1"; + bulkTest_shouldntWork(key, cert, alg, curve); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtDiverseDataTypes.cs b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtDiverseDataTypes.cs new file mode 100644 index 0000000..421013e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtDiverseDataTypes.cs @@ -0,0 +1,70 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.Jwt.Features +{ + [TestFixture] + public class TestJwtDiverseDataTypes : SecurityAPITestObject + { + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static SymmetricKeyGenerator keyGen; + protected PrivateClaims claimslevel1; + protected PrivateClaims claimslevel2; + protected PrivateClaims claimslevel3; + protected static string token; + protected static string currentDate; + protected static string hexaKey; + + [SetUp] + public virtual void SetUp() + { + jwt = new JWTCreator(); + options = new JWTOptions(); + + keyGen = new SymmetricKeyGenerator(); + claimslevel1 = new PrivateClaims(); + claimslevel2 = new PrivateClaims(); + claimslevel3 = new PrivateClaims(); + + + hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + + options.AddRegisteredClaim("aud", "jitsi"); + options.AddRegisteredClaim("iss", "my_client"); + options.AddRegisteredClaim("sub", "meet.jit.si"); + + + claimslevel1.setClaim("room", "*"); + claimslevel1.setNumericClaim("uno", 1); + claimslevel1.setBooleanClaim("boolean", true); + //1607626804 + claimslevel1.setDateClaim("date", 1607626804); + + claimslevel1.setClaim("context", claimslevel2); + + claimslevel2.setClaim("user", claimslevel3); + claimslevel3.setClaim("avatar", "https:/gravatar.com/avatar/abc123"); + claimslevel3.setClaim("name", "John Doe"); + claimslevel3.setClaim("email", "jdoe@example.com"); + claimslevel3.setClaim("id", "abcd:a1b2c3-d4e5f6-0abc1-23de-abcdef01fedcba"); + claimslevel2.setClaim("group", "a123-123-456-789"); + + options.SetSecret(hexaKey); + token = jwt.DoCreate("HS256", claimslevel1, options); + } + + [Test] + public void TestPositive() + { + string payload = jwt.GetPayload(token); + bool verification = jwt.DoVerify(token, "HS256", claimslevel1, options); + + True(verification, jwt); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtHeaderParameters.cs b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtHeaderParameters.cs new file mode 100644 index 0000000..e260e56 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtHeaderParameters.cs @@ -0,0 +1,98 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using NUnit.Framework; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusComons; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWTUtils; + +namespace SecurityAPITest.Jwt.Features +{ + [TestFixture] + public class TestJwtHeaderParameters: SecurityAPITestObject + { + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static SymmetricKeyGenerator keyGen; + protected static DateUtil du; + protected PrivateClaims claims; + protected static string token; + protected static string currentDate; + protected static string hexaKey; + + [SetUp] + public virtual void SetUp() + { + jwt = new JWTCreator(); + options = new JWTOptions(); + du = new DateUtil(); + keyGen = new SymmetricKeyGenerator(); + claims = new PrivateClaims(); + + + + hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + + options.AddRegisteredClaim("aud", "jitsi"); + options.AddRegisteredClaim("iss", "my_client"); + options.AddRegisteredClaim("sub", "meet.jit.si"); + + + claims.setClaim("hola", "hola"); + + options.AddHeaderParameter("cty", "twilio-fpa;v=1"); + options.SetSecret(hexaKey); + + token = jwt.DoCreate("HS256", claims, options); + } + + [Test] + public void TestPositive() + { + bool verification = jwt.DoVerify(token, "HS256", claims, options); + True(verification, jwt); + } + + [Test] + public void TestNegative1() + { + options.AddHeaderParameter("pepe", "whatever"); + bool verification = jwt.DoVerify(token, "HS256", claims, options); + Assert.IsFalse(verification); + Assert.IsFalse(jwt.HasError()); + } + + [Test] + public void TestNegative2() + { + JWTOptions op = new JWTOptions(); + op.AddRegisteredClaim("aud", "jitsi"); + op.AddRegisteredClaim("iss", "my_client"); + op.AddRegisteredClaim("sub", "meet.jit.si"); + op.SetSecret(hexaKey); + op.AddHeaderParameter("pepe", "whatever"); + + bool verification = jwt.DoVerify(token, "HS256", claims, op); + Assert.IsFalse(verification); + Assert.IsFalse(jwt.HasError()); + + } + + [Test] + public void TestNegative3() + { + JWTOptions op = new JWTOptions(); + op.AddRegisteredClaim("aud", "jitsi"); + op.AddRegisteredClaim("iss", "my_client"); + op.AddRegisteredClaim("sub", "meet.jit.si"); + op.SetSecret(hexaKey); + //op.AddHeaderParameter("pepe", "whatever"); + + bool verification = jwt.DoVerify(token, "HS256", claims, op); + // Assert.IsFalse(verification); + Assert.IsFalse(jwt.HasError()); + + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtNestedClaims.cs b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtNestedClaims.cs new file mode 100644 index 0000000..ed406cc --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtNestedClaims.cs @@ -0,0 +1,97 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusComons; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusJWTUtils; +using GeneXusJWT.GenexusJWTClaims; + +namespace SecurityAPITest.Jwt.Features +{ + [TestFixture] + public class TestJwtNestedClaims: SecurityAPITestObject + { + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static SymmetricKeyGenerator keyGen; + protected PrivateClaims claimslevel1; + protected PrivateClaims claimslevel2; + protected PrivateClaims claimslevel3; + protected static string token; + protected static string currentDate; + protected static string hexaKey; + + [SetUp] + public virtual void SetUp() + { + jwt = new JWTCreator(); + options = new JWTOptions(); + + keyGen = new SymmetricKeyGenerator(); + claimslevel1 = new PrivateClaims(); + claimslevel2 = new PrivateClaims(); + claimslevel3 = new PrivateClaims(); + + + hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + + options.AddRegisteredClaim("aud", "jitsi"); + options.AddRegisteredClaim("iss", "my_client"); + options.AddRegisteredClaim("sub", "meet.jit.si"); + + + claimslevel1.setClaim("room", "*"); + + claimslevel1.setClaim("context", claimslevel2); + + claimslevel2.setClaim("user", claimslevel3); + claimslevel3.setClaim("avatar", "https:/gravatar.com/avatar/abc123"); + claimslevel3.setClaim("name", "John Doe"); + claimslevel3.setClaim("email", "jdoe@example.com"); + claimslevel3.setClaim("id", "abcd:a1b2c3-d4e5f6-0abc1-23de-abcdef01fedcba"); + claimslevel2.setClaim("group", "a123-123-456-789"); + + options.SetSecret(hexaKey); + token = jwt.DoCreate("HS256", claimslevel1, options); + } + + [Test] + public void TestPositive() + { + bool verification = jwt.DoVerify(token, "HS256", claimslevel1, options); + True(verification, jwt); + } + + [Test] + public void TestNegative1() + { + claimslevel2.setClaim("pepe", "whatever"); + bool verification = jwt.DoVerify(token, "HS256", claimslevel1, options); + Assert.IsFalse(verification); + Assert.IsFalse(jwt.HasError()); + } + + [Test] + public void TestNegative2() + { + PrivateClaims claimslevel11 = new PrivateClaims(); + PrivateClaims claimslevel21 = new PrivateClaims(); + PrivateClaims claimslevel31 = new PrivateClaims(); + claimslevel11.setClaim("room", "*"); + + claimslevel11.setClaim("context", claimslevel21); + + claimslevel21.setClaim("user", claimslevel31); + claimslevel31.setClaim("avatar", "https:/gravatar.com/avatar/abc123"); + claimslevel31.setClaim("name", "John Doe"); + claimslevel31.setClaim("email", "jdoe@example.com"); + claimslevel31.setClaim("id", "abcd:a1b2c3-d4e5f6-0abc1-23de-abcdef01fedcba"); + + bool verification = jwt.DoVerify(token, "HS256", claimslevel11, options); + Assert.IsFalse(verification); + Assert.IsFalse(jwt.HasError()); + } + } + + +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtRevocationList.cs b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtRevocationList.cs new file mode 100644 index 0000000..55be346 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtRevocationList.cs @@ -0,0 +1,67 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using NUnit.Framework; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWTClaims; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusJWTUtils; + +namespace SecurityAPITest.Jwt.Features +{ + [TestFixture] + public class TestJwtRevocationList: SecurityAPITestObject + { + protected static String ID; + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static SymmetricKeyGenerator keyGen; + protected static String token; + protected static RevocationList rList; + + [SetUp] + public virtual void SetUp() + { + jwt = new JWTCreator(); + options = new JWTOptions(); + keyGen = new SymmetricKeyGenerator(); + claims = new PrivateClaims(); + rList = new RevocationList(); + + + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + ID = "0696bb20-6223-4a1c-9ebf-e15c74387b9c, 0696bb20-6223-4a1c-9ebf-e15c74387b9c";//&guid.Generate() + options.AddRegisteredClaim("jti", ID); + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + + String hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + options.SetSecret(hexaKey); + options.AddRevocationList(rList); + + token = jwt.DoCreate("HS256", claims, options); + } + + [Test] + public void TestPositive() + { + bool verification = jwt.DoVerify(token, "HS256", claims, options); + Assert.IsTrue(verification); + True(verification, jwt); + } + + [Test] + public void TestNegative() + { + rList.addIDToRevocationList(ID); + bool verification = jwt.DoVerify(token, "HS256", claims, options); + Assert.IsFalse(verification); + Assert.IsFalse(jwt.HasError()); + + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtVerifyJustSignature.cs b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtVerifyJustSignature.cs new file mode 100644 index 0000000..4f28440 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Features/TestJwtVerifyJustSignature.cs @@ -0,0 +1,96 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWTUtils; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.Jwt.Features +{ + [TestFixture] + public class TestJwtVerifyJustSignature: SecurityAPITestObject + { + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static SymmetricKeyGenerator keyGen; + protected static DateUtil du; + protected PrivateClaims claims; + protected static string token; + protected static string currentDate; + protected static string hexaKey; + + [SetUp] + public virtual void SetUp() + { + jwt = new JWTCreator(); + options = new JWTOptions(); + du = new DateUtil(); + keyGen = new SymmetricKeyGenerator(); + claims = new PrivateClaims(); + + currentDate = du.GetCurrentDate(); + hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + + options.AddRegisteredClaim("aud", "jitsi"); + options.AddRegisteredClaim("iss", "my_client"); + options.AddRegisteredClaim("sub", "meet.jit.si"); + string expiration = du.CurrentPlusSeconds(200); + options.AddCustomTimeValidationClaim("exp", expiration, "20"); + + claims.setClaim("hola", "hola"); + + options.AddHeaderParameter("cty", "twilio-fpa;v=1"); + options.SetSecret(hexaKey); + + token = jwt.DoCreate("HS256", claims, options); + + } + + [Test] + public void testPositive_JustSign() + { + JWTOptions options1 = new JWTOptions(); + options1.SetSecret(hexaKey); + bool verification = jwt.DoVerifyJustSignature(token, "HS256", options1); + True(verification, jwt); + } + + [Test] + public void testComplete_JustSign() + { + bool verification = jwt.DoVerifyJustSignature(token, "HS256", options); + True(verification, jwt); + } + + [Test] + public void TestNegative_JustSign() + { + JWTOptions options1 = new JWTOptions(); + string hexaKey1 = keyGen.doGenerateKey("GENERICRANDOM", 256); + options1.SetSecret(hexaKey1); + bool verification = jwt.DoVerifyJustSignature(token, "HS256", options1); + Assert.IsFalse(verification); + Assert.IsTrue(jwt.HasError()); + } + + [Test] + public void TestPositive_Sign() + { + options.SetSecret(hexaKey); + bool verification = jwt.DoVerifySignature(token, "HS256", options); + True(verification, jwt); + } + + [Test] + public void TestNegative_Sign() + { + string hexaKey1 = keyGen.doGenerateKey("GENERICRANDOM", 256); + options.SetSecret(hexaKey1); + bool verification = jwt.DoVerifySignature(token, "HS256", options); + Assert.IsFalse(verification); + Assert.IsTrue(jwt.HasError()); + } + + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue81664.cs b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue81664.cs new file mode 100644 index 0000000..49481ef --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue81664.cs @@ -0,0 +1,68 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWTUtils; +using GeneXusJWT.GenexusJWT; +using SecurityAPICommons.Utils; + +namespace SecurityAPITest.Jwt.Other +{ + [TestFixture] + public class TestIssue81664: SecurityAPITestObject + { + private static CertificateX509 cert; + private static PrivateKeyManager key; + private static JWTOptions options; + private static PrivateClaims claims; + private static string token; + private static string expected; + private static DateUtil du; + private static JWTCreator jwt; + + [SetUp] + public virtual void SetUp() + { + cert = new CertificateX509(); + key = new PrivateKeyManager(); + options = new JWTOptions(); + claims = new PrivateClaims(); + du = new DateUtil(); + jwt = new JWTCreator(); + + + cert.Load(BASE_PATH + "dummycerts\\RSA_sha256_1024\\sha256_cert.crt"); + options.SetCertificate(cert); + + + key.Load(BASE_PATH + "dummycerts\\RSA_sha256_1024\\sha256d_key.pem"); + options.SetPrivateKey(key); + // + // carga de privateClaim (es parte del Payload) + claims.setClaim("GeneXus", "Viglia"); + + + // Carga de Registered Claims + options.AddRegisteredClaim("iss", "Martin"); + options.AddRegisteredClaim("sub", "Martin1"); + options.AddRegisteredClaim("aud", "martivigliadoocebbooyo.docebosaas.com"); + options.AddCustomTimeValidationClaim("iat", du.GetCurrentDate(), "20"); + options.AddCustomTimeValidationClaim("exp", du.CurrentPlusSeconds(3600), "20"); + options.AddPublicClaim("client_id", "Martin"); + + token = jwt.DoCreate("RS256", claims, options); + expected = "{\"alg\":\"RS256\",\"typ\":\"JWT\"}"; + } + + [Test] + public void Test_algorithm() + { + string header = jwt.GetHeader(token); + Assert.IsTrue(SecurityUtils.compareStrings(header, expected)); + } + + + + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue83649.cs b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue83649.cs new file mode 100644 index 0000000..96ca423 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue83649.cs @@ -0,0 +1,56 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWTClaims; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Utils; + +namespace SecurityAPITest.Jwt.Other +{ + [TestFixture] + public class TestIssue83649: SecurityAPITestObject + { + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static SymmetricKeyGenerator keyGen; + protected static string payload; + protected static string expected; + + + [SetUp] + public virtual void SetUp() + { + jwt = new JWTCreator(); + options = new JWTOptions(); + keyGen = new SymmetricKeyGenerator(); + claims = new PrivateClaims(); + + options.AddCustomTimeValidationClaim("exp", "2020/07/20 17:56:51", "20"); + options.AddCustomTimeValidationClaim("iat", "2020/07/20 17:56:51", "20"); + options.AddCustomTimeValidationClaim("nbf", "2020/07/20 17:56:51", "20"); + claims.setClaim("hola1", "hola1"); + string hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + options.SetSecret(hexaKey); + string token = jwt.DoCreate("HS256", claims, options); + payload = jwt.GetPayload(token); + + + expected = "{\"hola1\":\"hola1\",\"exp\":1595267811,\"iat\":1595267811,\"nbf\":1595267811}"; + } + + [Test] + public void Test_timeClaims() + { + Assert.IsTrue(SecurityUtils.compareStrings(expected, payload)); + } + + + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84142.cs b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84142.cs new file mode 100644 index 0000000..4a0149b --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84142.cs @@ -0,0 +1,55 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using GeneXusJWT.GenexusComons; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; + +namespace SecurityAPITest.Jwt.Other +{ + [TestFixture] + public class TestIssue84142: SecurityAPITestObject + { + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static SymmetricKeyGenerator keyGenerator; + protected static JWTCreator jwt; + + + [SetUp] + public virtual void SetUp() + { + + + keyGenerator = new SymmetricKeyGenerator(); + jwt = new JWTCreator(); + options = new JWTOptions(); + claims = new PrivateClaims(); + + string hexaKey = keyGenerator.doGenerateKey("GENERICRANDOM", 256); + options.SetSecret(hexaKey); + + claims.setClaim("hola1", "hola1"); + + + } + + [Test] + public void Test_expValidationPositive() + { + options.AddCustomTimeValidationClaim("exp", "2030/07/07 10:15:20", "20"); + string token = jwt.DoCreate("HS256", claims, options); + bool validation = jwt.DoVerify(token, "HS256", claims, options); + Assert.IsTrue(validation); + } + + [Test] + public void Test_expValidationNegative() + { + options.AddCustomTimeValidationClaim("exp", "2019/07/07 10:15:20", "20"); + string token = jwt.DoCreate("HS256", claims, options); + bool validation = jwt.DoVerify(token, "HS256", claims, options); + Assert.IsFalse(validation); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84859.cs b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84859.cs new file mode 100644 index 0000000..670b68d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue84859.cs @@ -0,0 +1,50 @@ +using GeneXusJWT.GenexusJWT; +using NUnit.Framework; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SecurityAPITest.Jwt.Other +{ + [TestFixture] + public class TestIssue84859 : SecurityAPITestObject + { + protected static string token; + protected static JWTCreator jwt; + + [SetUp] + public virtual void SetUp() + { + token = "dummy"; + jwt = new JWTCreator(); + } + + [Test] + public void TestMalformedPayload() + { + string res = jwt.GetPayload(token); + Assert.IsTrue(SecurityUtils.compareStrings(res, "")); + Assert.IsTrue(jwt.HasError()); + } + + [Test] + public void TestMalformedHeader() + { + string res = jwt.GetHeader(token); + Assert.IsTrue(SecurityUtils.compareStrings(res, "")); + Assert.IsTrue(jwt.HasError()); + } + + [Test] + public void TestMalformedID() + { + string res = jwt.GetTokenID(token); + Assert.IsTrue(SecurityUtils.compareStrings(res, "")); + Assert.IsTrue(jwt.HasError()); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue86867.cs b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue86867.cs new file mode 100644 index 0000000..8b9ab6e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestIssue86867.cs @@ -0,0 +1,65 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.IO; + +namespace SecurityAPITest.Jwt.Other +{ + + + [TestFixture] + public class TestIssue86867 : SecurityAPITestObject + { + protected static JWTCreator jwt; + protected static JWTOptions options1; + protected static JWTOptions options2; + protected static PrivateClaims claims; + protected static string token; + protected static string path_RSA_sha256_1024; + + [SetUp] + public virtual void SetUp() + { + options1 = new JWTOptions(); + options2 = new JWTOptions(); + jwt = new JWTCreator(); + claims = new PrivateClaims(); + claims.setClaim("hola1", "hola1"); + path_RSA_sha256_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_1024"); + + String pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + String pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.crt"); + PrivateKeyManager key = new PrivateKeyManager(); + CertificateX509 cert = new CertificateX509(); + key.Load(pathKey); + cert.Load(pathCert); + + options1.SetCertificate(cert); + options1.SetPrivateKey(key); + options1.AddRegisteredClaim("iss", "GXSA"); + options1.AddRegisteredClaim("sub", "subject1"); + options1.AddRegisteredClaim("aud", "audience1"); + + options2.AddRegisteredClaim("iss", "GXSA"); + options2.AddRegisteredClaim("sub", "subject1"); + options2.AddRegisteredClaim("aud", "audience1"); + options2.SetCertificate(cert); + + token = jwt.DoCreate("RS256", claims, options1); + } + + [Test] + public void TestVerificationWithoutPrivateKey() + { + bool validation = jwt.DoVerify(token, "RS256", claims, options2); + //System.out.println("Error. Code: " + jwt.getErrorCode() + " Desc: " + jwt.getErrorDescription()); + Assert.IsTrue(validation); + } + } +} + + diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtDomainSpaces.cs new file mode 100644 index 0000000..d2b71b2 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtDomainSpaces.cs @@ -0,0 +1,58 @@ +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWTUtils; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.Jwt.Other +{ + [TestFixture] + public class TestJwtDomainSpaces : SecurityAPITestObject + { + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static SymmetricKeyGenerator keyGen; + protected static DateUtil du; + protected PrivateClaims claims; + protected static string currentDate; + protected static string hexaKey; + + [SetUp] + public virtual void SetUp() + { + jwt = new JWTCreator(); + options = new JWTOptions(); + du = new DateUtil(); + keyGen = new SymmetricKeyGenerator(); + claims = new PrivateClaims(); + + currentDate = du.GetCurrentDate(); + hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + + options.AddRegisteredClaim("aud ", "jitsi"); + options.AddRegisteredClaim(" iss", "my_client"); + options.AddRegisteredClaim(" sub ", "meet.jit.si"); + string expiration = du.CurrentPlusSeconds(200); + options.AddCustomTimeValidationClaim("exp", expiration, "20"); + + claims.setClaim("hola", "hola"); + + options.AddHeaderParameter("cty", "twilio-fpa;v=1"); + options.SetSecret(hexaKey); + + } + + [Test] + public void TestDomains() + { + + options.SetSecret(hexaKey); + string token = jwt.DoCreate("HS256 ", claims, options); + Assert.IsFalse(jwt.HasError()); + bool verification = jwt.DoVerifyJustSignature(token, " HS256", options); + True(verification, jwt); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtOtherFunctions.cs b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtOtherFunctions.cs new file mode 100644 index 0000000..b74bbc7 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Other/TestJwtOtherFunctions.cs @@ -0,0 +1,92 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using GeneXusJWT.GenexusJWT; +using GeneXusJWT.GenexusJWTClaims; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusComons; +using SecurityAPICommons.Utils; + +namespace SecurityAPITest.Jwt.Other +{ + [TestFixture] + public class TestJwtOtherFunctions: SecurityAPITestObject + { + protected static string ID; + protected static JWTCreator jwt; + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static SymmetricKeyGenerator keyGen; + protected static string token; + + [SetUp] + public virtual void SetUp() + { + options = new JWTOptions(); + jwt = new JWTCreator(); + claims = new PrivateClaims(); + keyGen = new SymmetricKeyGenerator(); + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + ID = "0696bb20-6223-4a1c-9ebf-e15c74387b9c, 0696bb20-6223-4a1c-9ebf-e15c74387b9c";// &guid.Generate() + options.AddRegisteredClaim("jti", ID); + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + } + + [Test] + public void GenerateToken() + { + string hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + options.SetSecret(hexaKey); + token = jwt.DoCreate("HS256", claims, options); + Assert.IsFalse(jwt.HasError()); + bool verification = jwt.DoVerify(token, "HS256", claims, options); + True(verification, jwt); + } + + [Test] + public void TestGetID() + { + string tID = jwt.GetTokenID(token); + Assert.IsTrue(SecurityUtils.compareStrings(ID, tID)); + } + + [Test] + public void TestGetPayload() + { + string payload = "{\"sub\":\"subject1\",\"aud\":\"audience1\",\"hola1\":\"hola1\",\"iss\":\"GXSA\",\"hola2\":\"hola2\",\"jti\":\"" + + ID + "\"}"; + string payload1 = "{\"hola1\":\"hola1\",\"hola2\":\"hola2\",\"iss\":\"GXSA\",\"sub\":\"subject1\",\"aud\":\"audience1\",\"jti\":\"" + + ID + "\"}"; + string payload2 = "{\"sub\":\"subject1\",\"aud\":\"audience1\",\"hola1\":\"hola1\",\"iss\":\"GXSA\",\"hola2\":\"hola2\",\"jti\":\"" + + ID + "\"}"; + + string tPayload = jwt.GetPayload(token); + Assert.IsTrue(SecurityUtils.compareStrings(payload, tPayload) || SecurityUtils.compareStrings(payload1, tPayload) + || SecurityUtils.compareStrings(payload2, tPayload)); + } + + [Test] + public void TestGetHeader() + { + string header = "{\"typ\":\"JWT\",\"alg\":\"HS256\"}"; + string header1 = "{\"alg\":\"HS256\",\"typ\":\"JWT\"}"; + string tHeader = jwt.GetHeader(token); + Assert.IsTrue(SecurityUtils.compareStrings(header, tHeader) || SecurityUtils.compareStrings(header1, tHeader)); + } + + [Test] + public void TestbadAlgorithm() + { + string hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256); + options.SetSecret(hexaKey); + string token1 = jwt.DoCreate("HS256", claims, options); + bool verification = jwt.DoVerify(token1, "RS256", claims, options); + Assert.IsFalse(verification); + Assert.IsTrue(jwt.HasError()); + } + + } +} diff --git a/test/dotnetframework/SecurityAPITest/Jwt/Symmetric/TestSymmetricJwt.cs b/test/dotnetframework/SecurityAPITest/Jwt/Symmetric/TestSymmetricJwt.cs new file mode 100644 index 0000000..8208710 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Jwt/Symmetric/TestSymmetricJwt.cs @@ -0,0 +1,69 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using GeneXusJWT.GenexusComons; +using GeneXusJWT.GenexusJWTUtils; +using SecurityAPICommons.Keys; +using GeneXusJWT.GenexusJWTClaims; +using GeneXusJWT.GenexusJWT; + +namespace SecurityAPITest.Jwt.Symmetric +{ + [TestFixture] + public class TestSymmetricJwt: SecurityAPITestObject + { + protected static JWTOptions options; + protected static PrivateClaims claims; + protected static GUID guid; + protected static DateUtil du; + protected static SymmetricKeyGenerator keyGenerator; + protected static JWTCreator jwt; + + [SetUp] + public virtual void SetUp() + { + + du = new DateUtil(); + guid = new GUID(); + keyGenerator = new SymmetricKeyGenerator(); + jwt = new JWTCreator(); + options = new JWTOptions(); + claims = new PrivateClaims(); + + options.AddRegisteredClaim("iss", "GXSA"); + options.AddRegisteredClaim("sub", "subject1"); + options.AddRegisteredClaim("aud", "audience1"); + + options.AddRegisteredClaim("jti", guid.Generate()); + + + options.AddCustomTimeValidationClaim("iat", du.GetCurrentDate(), "20"); + options.AddCustomTimeValidationClaim("nbf", du.GetCurrentDate(), "20"); + + claims.setClaim("hola1", "hola1"); + claims.setClaim("hola2", "hola2"); + + } + + [Test] + public void Test_HS256() + { + string hexaKey = keyGenerator.doGenerateKey("GENERICRANDOM", 256); + options.SetSecret(hexaKey); + string token = jwt.DoCreate("HS256", claims, options); + Assert.IsFalse(jwt.HasError()); + bool verification = jwt.DoVerify(token, "HS256", claims, options); + True(verification, jwt); + } + + [Test] + public void Test_HS512() + { + string hexaKey = keyGenerator.doGenerateKey("GENERICRANDOM", 512); + options.SetSecret(hexaKey); + string token = jwt.DoCreate("HS512", claims, options); + Assert.IsFalse(jwt.HasError()); + bool verification = jwt.DoVerify(token, "HS512", claims, options); + True(verification, jwt); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Properties/AssemblyInfo.cs b/test/dotnetframework/SecurityAPITest/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1d2092c --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Properties/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +//[assembly: AssemblyTitle("GeneXusCryptography")] +//[assembly: AllowPartiallyTrustedCallers] diff --git a/test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs new file mode 100644 index 0000000..c47a195 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs @@ -0,0 +1,42 @@ +using NUnit.Framework; +using SecurityAPICommons.Commons; +using SecurityAPICommons.Utils; +using System; +using System.IO; +using System.Reflection; + +namespace SecurityAPITest.SecurityAPICommons.commons +{ + public class SecurityAPITestObject + { + public string TestContextParameter(string key) { + return TestContext.Parameters[key]; + } + + static string GetStartupDirectory() + { + string dir = Assembly.GetCallingAssembly().GetName().CodeBase; + Uri uri = new Uri(dir); + return Path.GetDirectoryName(uri.LocalPath); + } + + protected static string BASE_PATH = GetStartupDirectory() + "\\"; + public void True(bool result, SecurityAPIObject obj) + { + Assert.IsTrue(result); + Assert.IsFalse(obj.HasError()); + } + + public void False(bool result, SecurityAPIObject obj) + { + + Assert.IsFalse(result); + Assert.IsTrue(obj.HasError()); + } + + public void Equals(string expected, string obtained, SecurityAPIObject obj) + { + Assert.IsTrue(SecurityUtils.compareStrings(expected, obtained) && !obj.HasError()); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestBase64.cs b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestBase64.cs new file mode 100644 index 0000000..b437403 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestBase64.cs @@ -0,0 +1,52 @@ +using SecurityAPICommons.Encoders; +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; + +namespace SecurityAPITest.SecurityAPICommons.encoders +{ + [TestFixture] + public class TestBase64: SecurityAPITestObject + { + protected static string expected_plainText; + protected static string expected_encoded; + protected static string expected_hexaText; + protected static Base64Encoder base64; + + [SetUp] + public virtual void SetUp() + { + expected_plainText = "hello world"; + expected_encoded = "aGVsbG8gd29ybGQ="; + expected_hexaText = "68656C6C6F20776F726C64"; + base64 = new Base64Encoder(); + } + + [Test] + public void TestToBase64() + { + string encoded = base64.toBase64(expected_plainText); + Equals(expected_encoded, encoded, base64); + } + + [Test] + public void TestToPlainText() + { + string plainText = base64.toPlainText(expected_encoded); + Equals(expected_plainText, plainText, base64); + } + + [Test] + public void TestTostringHexa() + { + string hexaText = base64.toStringHexa(expected_encoded); + Equals(expected_hexaText, hexaText, base64); + } + + [Test] + public void TestFromstringHexaToBase64() + { + string encoded = base64.fromStringHexaToBase64(expected_hexaText); + Equals(expected_encoded, encoded, base64); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestHexa.cs b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestHexa.cs new file mode 100644 index 0000000..f880fd3 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/encoders/TestHexa.cs @@ -0,0 +1,36 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using SecurityAPICommons.Encoders; + +namespace SecurityAPITest.SecurityAPICommons.encoders +{ + [TestFixture] + public class TestHexa: SecurityAPITestObject + { + protected static string expected_plainText; + protected static string expected_hexaText; + protected static HexaEncoder hexa; + + [SetUp] + public virtual void SetUp() + { + expected_plainText = "hello world"; + expected_hexaText = "68656C6C6F20776F726C64"; + hexa = new HexaEncoder(); + } + + [Test] + public void TestFromHexa() + { + string plainText = hexa.fromHexa(expected_hexaText); + Equals(expected_plainText, plainText, hexa); + } + + [Test] + public void TestToHexa() + { + string hexaText = hexa.toHexa(expected_plainText); + Equals(expected_hexaText, hexaText, hexa); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PrivateKey.cs b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PrivateKey.cs new file mode 100644 index 0000000..853d9a1 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PrivateKey.cs @@ -0,0 +1,39 @@ +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.SecurityAPICommons.keys +{ + [TestFixture] + public class TestBase64PrivateKey : SecurityAPITestObject + { + protected static string path; + protected static string base64string; + + [SetUp] + public virtual void SetUp() + { + path = BASE_PATH + "dummycerts\\RSA_sha256_1024\\sha256d_key.pem"; + base64string = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMZ8m4ftIhfrdugi5kEszRZr5IRuqGDLTex+CfVnhnBYXyQgJXeCI0eyRYUAbNzw/9MPdFN//pV26AXeH/ajORVu1JVoOACZdNOIPFnwXXh8oBxNxLAYlqoK2rAL+/tns8rKqqS4p8HSat9tj07TUXnsYJmmbXJM/eB94Ex66D1ZAgMBAAECgYA1xrTs0taV3HnO0wXHSrgWBw1WxBRihTKLjGpuTqoh7g943izIgD3GwwoKyt6zzafCK0G9DcSQAjNCw7etPvPL3FxwhDl+AHSv9JcChk/auICtMWwjurG4npto+s3byj/N00Idpz1xuOgKd8k9sdoPBGKa8l+LL+adSXzoivLG8QJBAPDvbOLSs9petB2iM6w5/DiC8EoxqDaBc7I1JFCvPOfB7i1GFFxkQ7hlgxpvaPX3NHXjAZpgdOW68P/SjU0izKsCQQDS5bjrNo3xn/MbYKojzwprR/Bo8Kvbi4/2M9NE3GwHegVmx5I+df+J0aObrbBNPLs/rhrFtt12OtgxJaac+FYLAkEA8DUUbvO4wj7m/iBnug65irHo1V+6oFThv0tCIHsFkt4DEvoqdI62AZKbafCnSYqjr+CaCYqfIScG/Vay77OBLwJBAI8EYAmKPmn7+SW4wMh1z+/+ogbYJwNEOoVQkdXh0JSlZ+JSNleLN5ajhtq8x5EpPSYrEFbB8p8JurBhgwJx2g8CQQDrp9scoK8eKBJ2p/63xqLGYSN6OZQo/4Lkq3983rmHoDCAp3Bz1zUyxQB3UVyrOj4U44C7RtDNiMSZuCwvjYAI"; + } + + [Test] + public void TestImport() + { + PrivateKeyManager pkm = new PrivateKeyManager(); + bool loaded = pkm.FromBase64(base64string); + True(loaded, pkm); + } + + [Test] + public void TestExport() + { + PrivateKeyManager pkm = new PrivateKeyManager(); + pkm.Load(path); + string base64res = pkm.ToBase64(); + Assert.IsTrue(SecurityUtils.compareStrings(base64res, base64string)); + Assert.IsFalse(pkm.HasError()); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PublicKey.cs b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PublicKey.cs new file mode 100644 index 0000000..7a96955 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/keys/TestBase64PublicKey.cs @@ -0,0 +1,46 @@ +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SecurityAPITest.SecurityAPICommons.keys +{ + [TestFixture] + public class TestBase64PublicKey: SecurityAPITestObject + { + + protected static string path; + protected static string base64string; + + [SetUp] + public virtual void SetUp() + { + path = BASE_PATH + "dummycerts\\RSA_sha256_1024\\sha256_cert.pem"; + base64string = "MIIC/DCCAmWgAwIBAgIJAPmCVmfcc0IXMA0GCSqGSIb3DQEBCwUAMIGWMQswCQYDVQQGEwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQMA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNncmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4XDTIwMDcwODE4NDkxNVoXDTI1MDcwNzE4NDkxNVowgZYxCzAJBgNVBAYTAlVZMRMwEQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQKDAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25lMSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMZ8m4ftIhfrdugi5kEszRZr5IRuqGDLTex+CfVnhnBYXyQgJXeCI0eyRYUAbNzw/9MPdFN//pV26AXeH/ajORVu1JVoOACZdNOIPFnwXXh8oBxNxLAYlqoK2rAL+/tns8rKqqS4p8HSat9tj07TUXnsYJmmbXJM/eB94Ex66D1ZAgMBAAGjUDBOMB0GA1UdDgQWBBTfXY8eOfDONCZpFE0V34mJJeCYtTAfBgNVHSMEGDAWgBTfXY8eOfDONCZpFE0V34mJJeCYtTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBAAPv7AFlCSpJ32c/VYowlbk6UBhOKmVWBQlrAtvVQYtCKO/y9CEB8ikG19c8lHM9axnsbZR+G7g04Rfuiea3T7VPkSmUXPpz5fl6Zyk4LZg5Oji7MMMXGmr+7cpYWRhifCVwoxSgZEXt3d962IZ1Wei0LMO+4w4gnzPxqr8wVHnT"; + } + + [Test] + public void TestImport() + { + CertificateX509 cert = new CertificateX509(); + bool loaded = cert.FromBase64(base64string); + True(loaded, cert); + } + + + [Test] + public void TestExport() + { + CertificateX509 cert = new CertificateX509(); + cert.Load(path); + string base64res = cert.ToBase64(); + Assert.IsTrue(SecurityUtils.compareStrings(base64res, base64string)); + Assert.IsFalse(cert.HasError()); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/SecurityAPITest.csproj b/test/dotnetframework/SecurityAPITest/SecurityAPITest.csproj new file mode 100644 index 0000000..afd969f --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/SecurityAPITest.csproj @@ -0,0 +1,411 @@ + + + + net471 + false + SecurityAPITest + SecurityAPITest + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + \ No newline at end of file diff --git a/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs b/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs new file mode 100644 index 0000000..18d7a8f --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs @@ -0,0 +1,125 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using Sftp.GeneXusSftp; +using System.IO; +using System; + +namespace SecurityAPITest.Sftp +{ + [TestFixture] + public class TestSftp: SecurityAPITestObject + { + protected static string host; + protected static string user; + protected static string known_hosts; + protected static string password; + protected static string keyPath; + protected static string keyPassword; + protected static string localPath; + protected static string remoteDir; + protected static string remoteFilePath; + protected static string localDir; + protected static string pwd; + + [SetUp] + public virtual void SetUp() + { + host = TestContextParameter("gx_ftp_host"); + user = TestContextParameter("gx_ftp_user"); + string known_hosts_content_base64 = TestContextParameter("gx_ftp_known_hosts_content_base64"); + known_hosts = Path.Combine(BASE_PATH, "Temp", "sftptest", "key", "known_hosts"); + File.WriteAllBytes(known_hosts, Convert.FromBase64String(known_hosts_content_base64)); + password = TestContextParameter("gx_ftp_password"); + keyPath = Path.Combine(BASE_PATH, "Temp", "sftptest", "key", "id_rsa"); + string id_rsaConentBase64 = TestContextParameter("gx_ftp_id_rsa_content_base64"); + File.WriteAllBytes(keyPath, Convert.FromBase64String(id_rsaConentBase64)); + keyPassword = TestContextParameter("gx_ftp_password"); + localPath = Path.Combine(BASE_PATH, "Temp", "sftptest", "sftptest1.txt"); + remoteDir = "sftp"; + remoteFilePath = "sftp/sftptest1.txt"; + localDir = Path.Combine(BASE_PATH, "Temp", "sftptest", "back"); + } + + private SftpClient TestConnection(SftpOptions options) + { + SftpClient client = new SftpClient(); + bool connected = client.Connect(options); + True(connected, client); + return client; + } + + private void TestPut(SftpClient client) + { + bool put = client.Put(localPath, remoteDir); + True(put, client); + } + + private void TestGet(SftpClient client) + { + bool get = client.Get(remoteFilePath, localDir); + True(get, client); + } + + [Test] + public void TestWithUserPassword() + { + SftpOptions options = new SftpOptions(); + options.Host = host; + options.User = user; + options.Password = password; + options.AllowHostKeyChecking = false; + SftpClient client = TestConnection(options); + TestPut(client); + TestGet(client); + client.Disconnect(); + } + + [Test] + public void TestWithKey() + { + SftpOptions options = new SftpOptions(); + options.Host = host; + options.User = user; + options.Password = password; + options.AllowHostKeyChecking = false; + options.KeyPassword = keyPassword; + SftpClient client = TestConnection(options); + TestPut(client); + TestGet(client); + client.Disconnect(); + } + + [Test] + public void TestWithKeyAndKnown_Hosts() + { + SftpOptions options = new SftpOptions(); + options.Host = host; + options.User = user; + options.Password = password; + options.AllowHostKeyChecking = true; + options.KeyPassword = keyPassword; + options.KnownHostsPath = known_hosts; + SftpClient client = TestConnection(options); + TestPut(client); + TestGet(client); + client.Disconnect(); + } + + [Test] + public void TestRoot() + { + SftpOptions o = new SftpOptions(); + o.Host = host; + o.User = user; + o.Password = password; + o.AllowHostKeyChecking = false; + SftpClient c = new SftpClient(); + c.Connect(o); + bool put = c.Put(localPath, "/"); + True(put, c); + bool get = c.Get("sftptest1.txt", localPath); + True(get, c); + c.Disconnect(); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/Temp/bookSample.xml b/test/dotnetframework/SecurityAPITest/Temp/bookSample.xml new file mode 100644 index 0000000..673a13d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Temp/bookSample.xml @@ -0,0 +1,31 @@ + + + + Everyday Italian + Giada De Laurentiis + 2005 + 30.00 + + + Harry Potter + J K. Rowling + 2005 + 29.99 + + + XQuery Kick Start + James McGovern + Per Bothner + Kurt Cagle + James Linn + Vaidyanathan Nagarajan + 2003 + 49.99 + + + Learning XML + Erik T. Ray + 2003 + 39.95 + + \ No newline at end of file diff --git a/test/dotnetframework/SecurityAPITest/Temp/ftps/back/dummy.txt b/test/dotnetframework/SecurityAPITest/Temp/ftps/back/dummy.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/dotnetframework/SecurityAPITest/Temp/ftps/ftpstest.txt b/test/dotnetframework/SecurityAPITest/Temp/ftps/ftpstest.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/dotnetframework/SecurityAPITest/Temp/outputTestFilesC/dummy.txt b/test/dotnetframework/SecurityAPITest/Temp/outputTestFilesC/dummy.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/dotnetframework/SecurityAPITest/Temp/outputTestFilesJ/dummy.txt b/test/dotnetframework/SecurityAPITest/Temp/outputTestFilesJ/dummy.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/dotnetframework/SecurityAPITest/Temp/sftptest/back/dummy.txt b/test/dotnetframework/SecurityAPITest/Temp/sftptest/back/dummy.txt new file mode 100644 index 0000000..2995a4d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Temp/sftptest/back/dummy.txt @@ -0,0 +1 @@ +dummy \ No newline at end of file diff --git a/test/dotnetframework/SecurityAPITest/Temp/sftptest/key/dummy.txt b/test/dotnetframework/SecurityAPITest/Temp/sftptest/key/dummy.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/dotnetframework/SecurityAPITest/Temp/sftptest/sftptest1.txt b/test/dotnetframework/SecurityAPITest/Temp/sftptest/sftptest1.txt new file mode 100644 index 0000000..00ea0eb --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Temp/sftptest/sftptest1.txt @@ -0,0 +1,2 @@ +SFTP Java tutorial +https://www.baeldung.com/java-file-sftp diff --git a/test/dotnetframework/SecurityAPITest/Temp/tosign.xml b/test/dotnetframework/SecurityAPITest/Temp/tosign.xml new file mode 100644 index 0000000..e23e35e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Temp/tosign.xml @@ -0,0 +1,6 @@ + + + + Ola mundo + + \ No newline at end of file diff --git a/test/dotnetframework/SecurityAPITest/Temp/xmlID.xml b/test/dotnetframework/SecurityAPITest/Temp/xmlID.xml new file mode 100644 index 0000000..6f1dae7 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Temp/xmlID.xml @@ -0,0 +1,15 @@ + + + + Tove + Jani + Reminder + Don't forget me this weekend! + + + Jani + Tove + Re: Reminder + I will not + + \ No newline at end of file diff --git a/test/dotnetframework/SecurityAPITest/Temp/xmlIDSchema.xsd b/test/dotnetframework/SecurityAPITest/Temp/xmlIDSchema.xsd new file mode 100644 index 0000000..ea3aa3a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/Temp/xmlIDSchema.xsd @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestBase64Certificate.cs b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestBase64Certificate.cs new file mode 100644 index 0000000..8f3f935 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestBase64Certificate.cs @@ -0,0 +1,70 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using GeneXusXmlSignature.GeneXusCommons; +using SecurityAPICommons.Keys; +using GeneXusXmlSignature.GeneXusDSig; +using SecurityAPICommons.Utils; +using System.IO; + +namespace SecurityAPITest.XmlSignature.DSig +{ + [TestFixture] + public class TestBase64Certificate: SecurityAPITestObject + { + private string base64 = "MIIC/DCCAmWgAwIBAgIJAIh1DtAn5T0IMA0GCSqGSIb3DQEBBQUAMIGWMQswCQYDVQQGEwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQMA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNncmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4XDTIwMDcwODE4NDM1N1oXDTI1MDcwNzE4NDM1N1owgZYxCzAJBgNVBAYTAlVZMRMwEQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQKDAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25lMSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKvo5gGDQ2w0veZSDxd+nJc7w7z/Is+4iGhOEuK9A/U713RfBdXYx2prp+7BAkUrGYm+Z6SkXZ6r78Tl5D/L2pNeA6nn5geCoWH1KSFOlAvEnjXcGvkdo8bIE/Day3PWFdeIGD8Mt0badAoIM+0m6s5jfSu9N8o4I4UX9O4PoEwhAgMBAAGjUDBOMB0GA1UdDgQWBBSLvqEYCzyExQe0fuRFBXpHjVbb6TAfBgNVHSMEGDAWgBSLvqEYCzyExQe0fuRFBXpHjVbb6TAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAArYRju3NQeCspTxvpixMLLPWaYzxRmtUkEz1yr7VhlIH63RTIqbRcbP+40DRxx83LkIOJRdOcCVeLX3ZutknJglfrqFkUF5grWrhrHpd+IRSeN3lePMYa3GeeljTyrPINCwnv0YFLQOwRf8UlZcKAquJO2ouQZkVd9t1tRWTvNo"; + + private string path_RSA_sha1_1024; + private string xmlUnsignedPath; + private string pathSigned; + private DSigOptions options; + private string pathKey; + private string xmlSignedPathRoot; + + [SetUp] + public virtual void SetUp() + { + path_RSA_sha1_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha1_1024"); + + options = new DSigOptions(); + + xmlUnsignedPath = Path.Combine(BASE_PATH, "Temp", "toSign.xml"); + pathSigned = "base64.xml"; + pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + xmlSignedPathRoot = Path.Combine(BASE_PATH, "Temp", "outputTestFilesJ"); + + } + + [Test] + public void TestSignBase64() + { + CertificateX509 newCert = new CertificateX509(); + bool loaded = newCert.FromBase64(base64); + Assert.IsTrue(loaded); + True(loaded, newCert); + PrivateKeyManager key = new PrivateKeyManager(); + bool privateLoaded = key.Load(pathKey); + Assert.IsTrue(privateLoaded); + True(privateLoaded, key); + XmlDSigSigner signer = new XmlDSigSigner(); + bool result = signer.DoSignFile(xmlUnsignedPath, key, newCert, xmlSignedPathRoot + pathSigned, options); + Assert.IsTrue(result); + True(result, signer); + bool verify = signer.DoVerifyFile(xmlSignedPathRoot + pathSigned, options); + Assert.IsTrue(verify); + True(verify, signer); + } + + [Test] + public void TestToBase64() + { + CertificateX509 newCert = new CertificateX509(); + bool loaded = newCert.FromBase64(base64); + Assert.IsTrue(loaded); + True(loaded, newCert); + string newBase64 = newCert.ToBase64(); + bool result = SecurityUtils.compareStrings(newBase64, base64); + Assert.IsTrue(result); + True(result, newCert); + } + } +} diff --git a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestFindID.cs b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestFindID.cs new file mode 100644 index 0000000..69e3e24 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestFindID.cs @@ -0,0 +1,47 @@ +using GeneXusXmlSignature.GeneXusCommons; +using GeneXusXmlSignature.GeneXusDSig; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPICommons.Utils; +using SecurityAPITest.SecurityAPICommons.commons; + +namespace SecurityAPITest.XmlSignature.DSig +{ + [TestFixture] + public class TestFindID : SecurityAPITestObject + { + private CertificateX509 cert; + private PrivateKeyManager key; + private XmlDSigSigner signer; + private DSigOptions options; + private string xmlInput; + private string xPath; + + [SetUp] + public virtual void SetUp() + { + cert = new CertificateX509(); + cert.Load(BASE_PATH + "dummycerts\\RSA_sha256_1024\\sha256_cert.crt"); + key = new PrivateKeyManager(); + key.Load(BASE_PATH + "dummycerts\\RSA_sha256_1024\\sha256d_key.pem"); + + signer = new XmlDSigSigner(); + options = new DSigOptions(); + + options.IdentifierAttribute = "Id"; + + xmlInput = "191131102046000145352101143101700029885500500001660115740578482021-01-26T11:12:34-03:0021021011.00Ciencia da Operacao"; + xPath = "#ID2102103521011431017000298855005000016601157405784801"; + } + + [Test] + public void TestFindID1() + { + //System.Diagnostics.Debugger.Launch(); + string signed = signer.DoSignElement(xmlInput, xPath, key, cert, options); + Assert.IsFalse(SecurityUtils.compareStrings(signed, "")); + Assert.IsFalse(signer.HasError()); + } + + } +} diff --git a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs new file mode 100644 index 0000000..9a7e531 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs @@ -0,0 +1,463 @@ +using SecurityAPITest.SecurityAPICommons.commons; +using NUnit.Framework; +using GeneXusXmlSignature.GeneXusCommons; +using SecurityAPICommons.Commons; +using SecurityAPICommons.Keys; +using GeneXusXmlSignature.GeneXusUtils; +using GeneXusXmlSignature.GeneXusDSig; +using SecurityAPICommons.Config; +using System.IO; + +namespace SecurityAPITest.XmlSignature.DSig +{ + [TestFixture] + public class TestRSASigning: SecurityAPITestObject + + { + private static string path_RSA_sha1_1024; + private static string path_RSA_sha256_1024; + private static string path_RSA_sha256_2048; + private static string path_RSA_sha512_2048; + + private static string xmlUnsigned; + private static string xmlUnsignedPath; + private static string xmlSignedPathRoot; + + private static string alias; + private static string password; + + private static string dSigType; + + private static string[] arrayCanonicalization; + private static string[] arrayKeyInfoType; + + private static DSigOptions options; + private static DSigOptions optionsXPath; + private static DSigOptions optionsID; + + private static Error error; + + private static string xmlUnsignedXPathFile; + private static string xPath; + private static string xmlUnsignedXPath; + + private static string xmlUnsignedIDPathFile; + private static string identifierAttribute; + private static string id; + private static string xmlUnsignedID; + private static string xmlIDSchemaPath; + + private static EncodingUtil eu; + + [SetUp] + public virtual void SetUp() + { + eu = new EncodingUtil(); + eu.setEncoding("UTF_8"); + path_RSA_sha1_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha1_1024"); + path_RSA_sha256_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_1024"); + path_RSA_sha256_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha256_2048"); + path_RSA_sha512_2048 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha512_2048"); + + alias = "1"; + password = "dummy"; + + xmlUnsigned = "" + "" + + " " + " Ola mundo" + " " + ""; + + xmlUnsignedPath = Path.Combine(BASE_PATH, "Temp", "toSign.xml"); + xmlSignedPathRoot = Path.Combine(BASE_PATH, "Temp", "outputTestFilesC"); + + dSigType = "ENVELOPED"; + arrayCanonicalization = new string[] { "C14n_WITH_COMMENTS", "C14n_OMIT_COMMENTS", "exc_C14n_OMIT_COMMENTS", + "exc_C14N_WITH_COMMENTS" }; + arrayKeyInfoType = new string[] { "KeyValue", "X509Certificate", "NONE" }; + + options = new DSigOptions(); + + optionsXPath = new DSigOptions(); + + error = new Error(); + xmlUnsignedXPathFile = Path.Combine(BASE_PATH, "Temp", "bookSample.xml"); + xPath = "/bookstore/book[1]"; + + xmlUnsignedIDPathFile = Path.Combine(BASE_PATH, "Temp", "xmlID.xml"); + identifierAttribute = "id"; + id = "#tag1"; + xmlIDSchemaPath = Path.Combine(BASE_PATH, "Temp", "xmlIDSchema.xsd"); + + optionsID = new DSigOptions(); + optionsID.IdentifierAttribute = identifierAttribute; + + xmlUnsignedID = "\r\n" + "\r\n" + " \r\n" + + " Tove\r\n" + " Jani\r\n" + " Reminder\r\n" + + " Don't forget me this weekend!\r\n" + " \r\n" + " \r\n" + + " Jani\r\n" + " Tove\r\n" + " Re: Reminder\r\n" + + " I will not\r\n" + " \r\n" + ""; + + xmlUnsignedXPath = "\r\n" + "\r\n" + + "\r\n" + " Everyday Italian\r\n" + + " Giada De Laurentiis\r\n" + " 2005\r\n" + + " 30.00\r\n" + "\r\n" + "\r\n" + + " Harry Potter\r\n" + " J K. Rowling\r\n" + + " 2005\r\n" + " 29.99\r\n" + "\r\n" + + "\r\n" + " XQuery Kick Start\r\n" + + " James McGovern\r\n" + " Per Bothner\r\n" + + " Kurt Cagle\r\n" + " James Linn\r\n" + + " Vaidyanathan Nagarajan\r\n" + " 2003\r\n" + + " 49.99\r\n" + "\r\n" + "\r\n" + + " Learning XML\r\n" + " Erik T. Ray\r\n" + + " 2003\r\n" + " 39.95\r\n" + "\r\n" + ""; + } + + [Test] + public void Test_sha1_1024_DER() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.crt"); + string pathSigned = "Test_sha1_1024_DER"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + + } + + [Test] + public void Test_sha1_1024_PEM() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.pem"); + string pathSigned = "Test_sha1_1024_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + } + + + + [Test] + public void Test_sha1_1024_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.p12"); + string pathSigned = "Test_sha1_1024_PKCS12"; + bulkTest(pathCert, pathKey, pathSigned, true, false); + } + + [Test] + public void Test_sha256_1024_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.crt"); + string pathSigned = "Test_sha256_1024_DER"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + } + + [Test] + public void Test_sha256_1024_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + string pathSigned = "Test_sha256_1024_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + } + + + + [Test] + public void Test_sha256_1024_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.p12"); + string pathSigned = "Test_sha256_1024_PKCS12"; + bulkTest(pathCert, pathKey, pathSigned, true, false); + } + + [Test] + public void Test_sha256_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.crt"); + string pathSigned = "Test_sha256_2048_DER"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + } + + [Test] + public void Test_sha256_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + string pathSigned = "Test_sha256_2048_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + } + + + + [Test] + public void Test_sha256_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.p12"); + string pathSigned = "Test_sha256_2048_PKCS12"; + bulkTest(pathCert, pathKey, pathSigned, true, false); + } + + [Test] + public void Test_sha512_2048_DER() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.crt"); + string pathSigned = "Test_sha512_2048_DER"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + } + + [Test] + public void Test_sha512_2048_PEM() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512d_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + string pathSigned = "Test_sha512_2048_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, false); + } + + + + [Test] + public void Test_sha512_2048_PKCS12() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.p12"); + string pathSigned = "Test_sha512_2048_PKCS12"; + bulkTest(pathCert, pathKey, pathSigned, true, false); + } + + + + + private void bulkTest(string pathCert, string pathKey, string pathSigned, bool ispkcs12, bool encrypted) + { + for (int k = 0; k < arrayKeyInfoType.Length; k++) + { + options.KeyInfoType = arrayKeyInfoType[k]; + optionsXPath.KeyInfoType = arrayKeyInfoType[k]; + optionsID.KeyInfoType = arrayKeyInfoType[k]; + CertificateX509 cert = new CertificateX509(); + if (ispkcs12) + { + cert.LoadPKCS12(pathCert, alias, password); + } + else { + cert.Load(pathCert); + } + PrivateKeyManager key = new PrivateKeyManager(); + + if (ispkcs12) + { + key.LoadPKCS12(pathKey, alias, password); + } + else + { + key.Load(pathKey); + } + /*if (ispkcs12) + { + key.LoadPKCS12(pathKey, alias, password); + } + else if(encrypted) + { + key.LoadEncrypted(pathKey, password); + }else + { + key.Load(pathKey); + }*/ + + bulkTestWithKeyInfo(cert, key, pathSigned); + bulkTestWithKeyInfoXPath(cert, key, pathSigned); + bulkTestWithKeyInfoID(cert, key, pathSigned); + } + + } + + private void bulkTestWithKeyInfoXPath(CertificateX509 certificate, PrivateKeyManager key, string pathSigned) + { +#if NETCORE + //******Net Core no tiene habilitado usar la transform xpath******// + Assert.IsTrue(true); +#else + XmlDSigSigner signer = new XmlDSigSigner(); + + string pathSignedXPath = pathSigned + "_xPAth"; + for (int c = 0; c < arrayCanonicalization.Length; c++) + { + + /**** TEST FILES ****/ + optionsXPath.DSigSignatureType = dSigType; + optionsXPath.Canonicalization = arrayCanonicalization[c]; + bool signedFile = signer.DoSignFileElement(xmlUnsignedXPathFile, xPath, key, certificate, + Path.Combine(xmlSignedPathRoot ,pathSignedXPath + ".xml"), optionsXPath); + Assert.IsTrue(signedFile); + True(signedFile, signer); + + bool verifyFile = false; + KeyInfoType keyInfo = KeyInfoTypeUtils.getKeyInfoType(optionsXPath.KeyInfoType, error); + if (keyInfo != KeyInfoType.NONE) + { + verifyFile = signer.DoVerifyFile(Path.Combine(xmlSignedPathRoot,pathSignedXPath + ".xml"), optionsXPath); + } + else + { + verifyFile = signer.DoVerifyFileWithCert(Path.Combine(xmlSignedPathRoot,pathSignedXPath + ".xml"), certificate, + optionsXPath); + } + //True(verifyFile, signer); + + /**** TEST STRINGS ****/ + + string signedString = signer.DoSignElement(xmlUnsignedXPath, xPath, key, certificate, optionsXPath); + bool resultSignString = false; + if (keyInfo != KeyInfoType.NONE) + { + resultSignString = signer.DoVerify(signedString, optionsXPath); + } + else + { + resultSignString = signer.DoVerifyWithCert(signedString, certificate, optionsXPath); + + } + //True(resultSignString, signer); + + } +#endif + } + + private void bulkTestWithKeyInfo(CertificateX509 certificate, PrivateKeyManager key, string pathSigned) + { + XmlDSigSigner signer = new XmlDSigSigner(); + + for (int c = 0; c < arrayCanonicalization.Length; c++) + { + + /**** TEST FILES ****/ + options.DSigSignatureType = dSigType; + options.Canonicalization = arrayCanonicalization[c]; + bool signedFile = signer.DoSignFile(xmlUnsignedPath, key, certificate, + Path.Combine(xmlSignedPathRoot,pathSigned + ".xml"), options); + Assert.IsTrue(signedFile); + True(signedFile, signer); + + bool verifyFile = false; + KeyInfoType keyInfo = KeyInfoTypeUtils.getKeyInfoType(options.KeyInfoType, error); + if (keyInfo != KeyInfoType.NONE) + { + verifyFile = signer.DoVerifyFile(Path.Combine(xmlSignedPathRoot,pathSigned + ".xml"), options); + } + else + { + verifyFile = signer.DoVerifyFileWithCert(Path.Combine(xmlSignedPathRoot,pathSigned + ".xml"), certificate, options); + } + True(verifyFile, signer); + + /**** TEST STRINGS ****/ + + string signedString = signer.DoSign(xmlUnsigned, key, certificate, options); + bool resultSignString = false; + if (keyInfo != KeyInfoType.NONE) + { + resultSignString = signer.DoVerify(signedString, options); + } + else + { + resultSignString = signer.DoVerifyWithCert(signedString, certificate, options); + + } + True(resultSignString, signer); + + } + } + + private void bulkTestWithKeyInfoID(CertificateX509 certificate, PrivateKeyManager key, string pathSigned) + { + XmlDSigSigner signer = new XmlDSigSigner(); + string pathSignedID = pathSigned + "_id"; + for (int c = 0; c < arrayCanonicalization.Length; c++) + { + + /**** TEST FILES ****/ + optionsID.DSigSignatureType = dSigType; + optionsID.Canonicalization = arrayCanonicalization[c]; + + optionsID.XmlSchemaPath = xmlIDSchemaPath; + bool signedFile = signer.DoSignFileElement(xmlUnsignedIDPathFile, id, key, certificate, + Path.Combine(xmlSignedPathRoot, pathSignedID + ".xml"), optionsID); + Assert.IsTrue(signedFile); + True(signedFile, signer); + + bool verifyFile = false; + optionsID.XmlSchemaPath = ""; + KeyInfoType keyInfo = KeyInfoTypeUtils.getKeyInfoType(optionsID.KeyInfoType, error); + if (keyInfo != KeyInfoType.NONE) + { + + verifyFile = signer.DoVerifyFile(Path.Combine(xmlSignedPathRoot, pathSignedID + ".xml"), optionsID); + } + else + { + verifyFile = signer.DoVerifyFileWithCert(Path.Combine(xmlSignedPathRoot,pathSignedID + ".xml"), certificate, + optionsID); + } + True(verifyFile, signer); + + /**** TEST STRINGS ****/ + optionsID.XmlSchemaPath = xmlIDSchemaPath; + string signedString = signer.DoSignElement(xmlUnsignedID, id, key, certificate, optionsID); + bool resultSignString = false; + + optionsID.XmlSchemaPath = ""; + if (keyInfo != KeyInfoType.NONE) + { + resultSignString = signer.DoVerify(signedString, optionsID); + } + else + { + resultSignString = signer.DoVerifyWithCert(signedString, certificate, optionsID); + + } + Assert.IsTrue(resultSignString); + True(resultSignString, signer); + + } + } + + /*[Test] + public void Test_sha256_1024_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_1024, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_1024, "sha256_cert.pem"); + string pathSigned = "Test_sha256_1024_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, true); + } + + [Test] + public void Test_sha1_1024_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha1_1024, "sha1_key.pem"); + string pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.pem"); + string pathSigned = "Test_sha1_1024_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, true); + } + + [Test] + public void Test_sha256_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha256_2048, "sha256_key.pem"); + string pathCert = Path.Combine(path_RSA_sha256_2048, "sha256_cert.pem"); + string pathSigned = "Test_sha256_2048_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, true); + } + + [Test] + public void Test_sha512_2048_PEM_Encrypted() + { + string pathKey = Path.Combine(path_RSA_sha512_2048, "sha512_key.pem"); + string pathCert = Path.Combine(path_RSA_sha512_2048, "sha512_cert.pem"); + string pathSigned = "Test_sha512_2048_PEM"; + bulkTest(pathCert, pathKey, pathSigned, false, true); + }*/ + } +} diff --git a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs new file mode 100644 index 0000000..0be32f2 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs @@ -0,0 +1,58 @@ +using GeneXusXmlSignature.GeneXusCommons; +using GeneXusXmlSignature.GeneXusDSig; +using NUnit.Framework; +using SecurityAPICommons.Keys; +using SecurityAPITest.SecurityAPICommons.commons; +using System.IO; + +namespace SecurityAPITest.XmlSignature.DSig +{ + [TestFixture] + public class TestXmlSignatureDomainSpaces : SecurityAPITestObject + { + private static string path_RSA_sha1_1024; + private static string xmlUnsigned; + private static string dSigType; + private static DSigOptions options; + private static string pathKey; + private static string pathCert; + private static XmlDSigSigner signer; + private static PrivateKeyManager key; + private static CertificateX509 cert; + + [SetUp] + public virtual void SetUp() + { + signer = new XmlDSigSigner(); + path_RSA_sha1_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha1_1024"); + xmlUnsigned = "" + "" + + " " + " Ola mundo" + " " + ""; + dSigType = "ENVELOPED "; + options = new DSigOptions(); + + pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); + pathCert = Path.Combine(path_RSA_sha1_1024, "sha1_cert.crt"); + + key = new PrivateKeyManager(); + cert = new CertificateX509(); + } + + /*[Test] + public void TestDomains() + { + key.Load(pathKey); + Assert.IsFalse(key.HasError()); + cert.Load(pathCert); + Assert.IsFalse(cert.HasError()); + options.DSigSignatureType = dSigType; + options.Canonicalization = "C14n_OMIT_COMMENTS "; + options.KeyInfoType = " X509Certificate"; + string signed = signer.DoSign(xmlUnsigned, key, cert, options); + //System.out.println("Error. Code: " + signer.getErrorCode() + " Desc: " + signer.getErrorDescription()); + Assert.IsFalse(signer.HasError()); + bool verified = signer.DoVerify(signed, options); + True(verified, signer); + }*/ + + } +} diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha1/sha1_cert.crt b/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha1/sha1_cert.crt new file mode 100644 index 0000000000000000000000000000000000000000..05139c26d01e4307906585c0128aa0066706f9f9 GIT binary patch literal 691 zcmXqLVp?y|#ALpJnTe5!iId@8M<^rzgkM$$oNVk`Z64=rSr`o(rx|hs`OKj#Y{E>T zk%qzsf*=kD50`I#UP)?MW=d*4OpqN#P{4o>q>_t=-90rgHKMfGP|$!MB*M+Z5uBP_ zT9jE*X((hM01{&6;Ve!sO3W?D&r3B_F;HUT1lr&BotKf5QA`vr5?~;0GchM;M@{0Mt(ri2%E!}JkW766R+fo+)UYfke z@aaj#1^0K!7?^16w7By*eFN9`Qq8ZE)Bhi?o%r}^TBYk5-qK6Q(r(;d9AMyQAPWp^ zSw0pq7LkDOADnMl9=LpXZu809nY)wg=Q;MfpHXBo$Vy$HIk$|T0i?KEL`ikEx%B>p~KvH51ij9DA3RIK+-3=OgtTO4*Yc1jMz!LK)tbM0AK#%;wW zny{sS|JSlFp>Nxs`se&P%p`PenX%*jE+rw&2~W7EYph~nnvBFE!UamDOKbIbn6~x=-Q{zcS{P#osLcwMn?_NXo3lpD!%SmkBEi?O0jZE^sQn zV9Syh^L*RAtmmdN9Md`YUpf3->+R}xqC=FL@{l2Rh8ar4*$hMf#c>&p#0W!_zUI63grRO8D zveK_M2`*n-xo7_t^UAQdA`vH+d@);iZ^4JhtPWwl(IUF5xV+XfJLo7%H%6*oFk@XX zVZ)}ZiX~Tn>1n+6Tb*Uxeqd9nxvKQn;w?|Vcx>X#XmwNEa9OpK#X9s{@|my=iSKy+ z3-?q#;ZR){ZnI6sEbw=BMzi47wI>2Hou2mJE7fv8{GcK|IcC@NqW?e7{J3!Fl&#~- z%?A$ozuzWf>AER1{l->}`*PkHT6GCCC$2GQOI*8b#}c7kOT06-nU~Hy-%$GCqDTAY zrn6ik`I?1AZV$izZ*Q zbUknUw)KvB?YBQPExP>7n(sqIf3nK#PkVL4xTZy`aku^Rzs>n&?h%OvR<|!IiSfR1 zoc%@M%oWdd^?(0%)zy>W+rD}88k7PA!VQiO^oU+O^nJwVR;~y zX5)rsCoV>&1&vP(8XuzMF=kL6^XXs{FxghL5|qbS8V_{b*w0zDoaN(faS`{_MIXw3 zg(tj^2wr*6+eVw|bnkzCXA_UdQ+_+mJ!FxUqEx5gsI|u-=}b~eTA^!{w6blfj|$(E?u=X5uI?m0gD`pTvmr-j5bBc8;4lDd(+ zf?-7{@1?do)$beni|PxXN<>_5`%%7KB|>jU+NYIsmo`tYTmG`TFIhD`@Yj)ZGW$Qu zom4;aRpR8Nl(-E`ZVC(f-*IztxTd&!Q}a?IN{bBz4fsJK+&mn? zsmY~9nI)BmLIwgLA!Z)V;`E}#+=BePR6`X5B{oi=1KPgxGIBDCiNa+Z(t!q5losnH z=jR&8iSrs67?>Ma7#WzDnHWU@xu!s_Ig~qi9bN|XGCMeYnHbqvwHsL&l$etkSl;^m ztePV|IoSN#Hi7j`U0pwyo$#HseA)Vo?-U;Fm~$oG{9t^*n*>!6x4_LdzUuqR6MpNf zvzjp$cuR3}w(D=2)g!-~@4DuiKQA8Gf1Ll3>#3%weYM9~)^lC&C6c~c|F2#gVBlvU z3k+;oJ{B<+k=E%gn!o;SWVJBRKd?5-=6mF;^|uY=LDI@B5(Z)o*cI@A6bQ4h8Za|5 z{zpzH%oz*@sZ53pOV(VjN!hGmrT1ei)3kMxzNa=NiidM<*#C^HeadIC%Ds29Jf7{o z%euihE3PlGk(`#Q={p6>-EuU2D7~FRvTw8|Nf+P Po6e59zPd6Y_3{}26*b>6 literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.p12 b/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..374d1c1adacbf57e2e89e4df82fa891c5ee0500f GIT binary patch literal 1258 zcmXqLVtK~I$ZXKWvWAUQtIebBJ1-+Ur+L~o!Oygn>0ID&rugKv$?;-`LA8>rpA>5cI)O}d3c#$fcbm= zQKnPR*Eow>GEDkz?_m`zsFNudkaR4Px#c7KO5tafQcROKUF}hN6Ok{v@@mQIFS1Iz zI-ivtwV3$imUqjt$nM2~@0Z$_1pdjC<+7gBGG)PS);KNRIMzI~j>xtJQUTdBr|Lf79YR@~8$lTjd^YROvf^|>P8+PvkftN#5ryl{EbzxHs? zf`o9B8&u74My@~PepRGIJ zt=qZn!-=Jj@69`v7*%pbqowd=;+4a`wR41c}`#s(KyIdS(a3ysXdGPhgVM zl37s2q;fPhti>ST-FhKYy{C5*|AQiJ-pBl#zdMHdd^x$OY`T}!gyZu$`+{~Uome?F z$@R~-qiQ`yhSIe^yk+h^4fNHNw`e@X`J7 zQw!tTVmUni@L1bCl3k-8$yt0W>fmJ_sUJexLC;TSx|L4({Of<{k?Q)>-`M;k_sn5D zcCqPMHXTd-LbvA>UEyba(#0-z zxLdvN<0+HCx>b3H?jKiBeQ3FELwldyff}ZlDYkztmQ2(W+P=|EagAT3`V-lYEN@Hs zRxi1g@?&E~`Y*YNvt|KZf5SEg-p$HSNhwRpmpI@gd{O?{h05-dl&bF;j;m_|6r05B zguk7Wq8;EZ`=9v)XcQRmVHS&CtrH*!-C&aler944V2+Q!YOJf#v-Cr$L4rs^}VfMo?gsI zS#lvkT1%zFz|cU^fRl|?n~#}Eij{#yBv<9@qQgIKw1=4Z_W!M7diZux)dCidFPG!5 LMDN=%85B4G9ndoL literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.pem new file mode 100644 index 0000000..e0f11d1 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_cert.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICsjCCAjigAwIBAgIJAOpC5nNoxOzcMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMDcwODIwNDY0MloXDTI1MDcwNzIwNDY0MlowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wdjAQBgcqhkjO +PQIBBgUrgQQAIgNiAATtTvl6nBuTUzfWthCvgoqK+abITZKnpq/R7iDguJzUXzfB +X1DsYCUURlGzPE0nvndg+y8nBTYBcEsaCwmHL7KajB+7DtcprPzo4D/xn/EK5SkV +P3tIzQXOiu8YYvU7/3ujUDBOMB0GA1UdDgQWBBSFl4Qp+v6xBTgwL8Ctajz3Weqv +2zAfBgNVHSMEGDAWgBSFl4Qp+v6xBTgwL8Ctajz3Weqv2zAMBgNVHRMEBTADAQH/ +MAoGCCqGSM49BAMCA2gAMGUCMQCkrNN8ZLMgOi74tQKWrhlNyrJhF1cJsL/mCoeU +8xZ5vd1qSOa73QWwM2pejlrIjcACMHFbTl2RCwbLbCR76DHZTjPugDx8KUXa68V7 +ADZutzqxm6f35IW2LLh+jn52Eid3mA== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_key.pem new file mode 100644 index 0000000..0edb562 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/ECDSA_sha256/sha256_key.pem @@ -0,0 +1,6 @@ +-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDAA0D8361/f9fjOjpsIDtiOMrmwXfHuCMQjwcIJ6H0nHIJgSzH8z6W6 +I1UPDpS4pKOgBwYFK4EEACKhZANiAATtTvl6nBuTUzfWthCvgoqK+abITZKnpq/R +7iDguJzUXzfBX1DsYCUURlGzPE0nvndg+y8nBTYBcEsaCwmHL7KajB+7DtcprPzo +4D/xn/EK5SkVP3tIzQXOiu8YYvU7/3s= +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/cert.pem new file mode 100644 index 0000000..a013cb1 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVTCCAgugAwIBAgIJANwmdZrFcHQzMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdWlydHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NTQzN1oXDTIwMTEyMTE0NTQzN1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1aXJ0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wSTATBgcqhkjO +PQIBBggqhkjOPQMBAQMyAARrK0QGr4PZmDmmHLAEqoX2iqy/IRHVr8Pl/1b9TgY+ +FJWHZC/XLrfFfAHnnFfxP72jUDBOMB0GA1UdDgQWBBQLfDLRzNVJPUVJ1UganVwP +etd8EjAfBgNVHSMEGDAWgBQLfDLRzNVJPUVJ1UganVwPetd8EjAMBgNVHRMEBTAD +AQH/MAoGCCqGSM49BAMCAzgAMDUCGQDtFyZY6eLUFPWW+/stXUrSmO29tJXG+lwC +GC+fDUj2zFf8+EqOHHvZ/OxP8iYa1VBAMA== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/key.pem new file mode 100644 index 0000000..20a7872 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MF8CAQEEGDmMXscXsK6l9tQBPGRa0oWPTaWeKCwJGKAKBggqhkjOPQMBAaE0AzIA +BGsrRAavg9mYOaYcsASqhfaKrL8hEdWvw+X/Vv1OBj4UlYdkL9cut8V8AeecV/E/ +vQ== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/cert.pem new file mode 100644 index 0000000..c03f85a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVjCCAgugAwIBAgIJAMhlDOUT16BgMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NTUzMFoXDTIwMTEyMTE0NTUzMFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wSTATBgcqhkjO +PQIBBggqhkjOPQMBAgMyAAT9T3YqDlL4C6o/Yj7afB5DqSFcPCqjtxyaeWDt46zz +cfqvqNVdTwOsl0QspCETORKjUDBOMB0GA1UdDgQWBBRG9hY022lpEY8HGBs2RVqn +s+jHbjAfBgNVHSMEGDAWgBRG9hY022lpEY8HGBs2RVqns+jHbjAMBgNVHRMEBTAD +AQH/MAoGCCqGSM49BAMCAzkAMDYCGQDANe7K+TgQ7obj4k0ZqZikK3NomHoHIh4C +GQDpkjPz9bj5JqMwadzLxVtHuCbp3C4N9yg= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/key.pem new file mode 100644 index 0000000..3096500 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v2/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MF8CAQEEGAvioKaRVADCgAl6EhSbusiWgqQ0ShCVt6AKBggqhkjOPQMBAqE0AzIA +BP1PdioOUvgLqj9iPtp8HkOpIVw8KqO3HJp5YO3jrPNx+q+o1V1PA6yXRCykIRM5 +Eg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/cert.pem new file mode 100644 index 0000000..2c3cdfd --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVDCCAgugAwIBAgIJAPxWi60KZG4EMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NTYyNFoXDTIwMTEyMTE0NTYyNFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wSTATBgcqhkjO +PQIBBggqhkjOPQMBAwMyAASz+GH5C+my9HF+ftcicQkKZf5S54velkoDz9ueLS6T ++B4phyBS4FGFPcF3rJV46G6jUDBOMB0GA1UdDgQWBBS7mLzgLZZ81YH2EGATdtLh +TTWGWjAfBgNVHSMEGDAWgBS7mLzgLZZ81YH2EGATdtLhTTWGWjAMBgNVHRMEBTAD +AQH/MAoGCCqGSM49BAMCAzcAMDQCGD/zKCKnIQsFWlFp1t2O//uMjYq/19KymwIY +b3FG2pOag3eFHOfZbiABMavvfJAbhZv6 +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/key.pem new file mode 100644 index 0000000..446339f --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime192v3/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MF8CAQEEGBm1NiFjPoDKptSeV4uQjb3Ok/60bQtaMaAKBggqhkjOPQMBA6E0AzIA +BLP4YfkL6bL0cX5+1yJxCQpl/lLni96WSgPP254tLpP4HimHIFLgUYU9wXeslXjo +bg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/cert.pem new file mode 100644 index 0000000..16d0fe9 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICbjCCAhmgAwIBAgIJAJLEycMWDn07MAoGCCqGSM49BAMCMIGXMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTElMCMGCSqGSIb3DQEJARYWc2VncmFtcG9uZUBnZW5leHVzLmNvbTAe +Fw0yMDEwMjIxNTA0MjRaFw0yMDExMjExNTA0MjRaMIGXMQswCQYDVQQGEwJVWTET +MBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQMA4GA1UE +CgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNncmFtcG9u +ZTElMCMGCSqGSIb3DQEJARYWc2VncmFtcG9uZUBnZW5leHVzLmNvbTBVMBMGByqG +SM49AgEGCCqGSM49AwEEAz4ABAAuriV4OGOVR7Fw/kjpt7/wBZQbEe/I/Gplv3Pf +iCXR+A8a3sCdnQJ7DKP3gk/lUvS8Qxn9OqSFWJ4XdaNQME4wHQYDVR0OBBYEFI/H +4rIvt8Yui/tl9WQripGsdDHiMB8GA1UdIwQYMBaAFI/H4rIvt8Yui/tl9WQripGs +dDHiMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDQwAwQAIeLgB15CFDYxbfSrKU +e0WnvzKXJmBHNxWv7TtG4N6XAh5hlSYwRq2HmG1vujPe79CwqiCFECwuW8YPfcsR +3p4= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/key.pem new file mode 100644 index 0000000..def0f0c --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHECAQEEHh8UQet0lNaTLqfmFcrgNV0f7CftIVS3yqgakLI73KAKBggqhkjOPQMB +BKFAAz4ABAAuriV4OGOVR7Fw/kjpt7/wBZQbEe/I/Gplv3PfiCXR+A8a3sCdnQJ7 +DKP3gk/lUvS8Qxn9OqSFWJ4XdQ== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/cert.pem new file mode 100644 index 0000000..d1ca998 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICbDCCAhegAwIBAgIJAOFYkFaKKHmGMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MDUxMVoXDTIwMTEyMTE1MDUxMVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wVTATBgcqhkjO +PQIBBggqhkjOPQMBBQM+AARnAT6M17sq6UGEZEJq7io4pnmSlY/3zjlbmi5WIVIh +KXgNSVODeY4t2xDtfkQnl1SlS5XgOcHYL9GxyNSjUDBOMB0GA1UdDgQWBBTThUSZ +CkjtjxrAm1UcUAXqGTiWADAfBgNVHSMEGDAWgBTThUSZCkjtjxrAm1UcUAXqGTiW +ADAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0MAMEACHlnHrkvH8Vhn+kv4sHn8 +grDZCzdQpmlTrMGIHlUS9AIeP9xBCkWzP/YYny5a7Kk1lPgXlJwdoPViIojBsFg9 +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/key.pem new file mode 100644 index 0000000..2a36f71 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v2/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHECAQEEHnRLl4h63L54nskPrvLfRz/iSbDlXDelySY9cJ0dJqAKBggqhkjOPQMB +BaFAAz4ABGcBPozXuyrpQYRkQmruKjimeZKVj/fOOVuaLlYhUiEpeA1JU4N5ji3b +EO1+RCeXVKVLleA5wdgv0bHI1A== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/cert.pem new file mode 100644 index 0000000..391808e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICbDCCAhegAwIBAgIJAJdIsvE83x8ZMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MDYxN1oXDTIwMTEyMTE1MDYxN1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wVTATBgcqhkjO +PQIBBggqhkjOPQMBBgM+AARHNP5z2rIFoL4iUNgY869nSGWMV95/yEC3GWjnnHdI +1QHE/hrcuOK+YbV8B5ny2NzwboTQz/4mRbuoRACjUDBOMB0GA1UdDgQWBBSh5O4q +ZabPX4YeO65MhL1EZTy9jzAfBgNVHSMEGDAWgBSh5O4qZabPX4YeO65MhL1EZTy9 +jzAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0MAMEACHioqcjx3gAgdk8nK38Sx +0gV22fmo7j0LP1tnDsH16gIeb9IcOB4w1I+uNxEz+m6pMIUT3wsrX7soKI3RQgtR +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/key.pem new file mode 100644 index 0000000..eaa70be --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime239v3/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHECAQEEHmcN3Lgf4vm1Lg451iIDVMjalAm/7YPiqWUnD8SXRqAKBggqhkjOPQMB +BqFAAz4ABEc0/nPasgWgviJQ2Bjzr2dIZYxX3n/IQLcZaOecd0jVAcT+Gty44r5h +tXwHmfLY3PBuhNDP/iZFu6hEAA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/cert.pem new file mode 100644 index 0000000..d198d70 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICdTCCAhugAwIBAgIJAIkfZlZb1VAbMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MDcxMFoXDTIwMTEyMTE1MDcxMFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAASrhEd/8BRVyHSyEcfPgROvbEHyBABKIEkTEglSR2HR +JPoUXlXk2PpssepPa/xM/BYoz4Tv8eF13Ob/LvhG1pwoo1AwTjAdBgNVHQ4EFgQU +T2yhjYW/nbEk0+LSUbUmKX8Qm00wHwYDVR0jBBgwFoAUT2yhjYW/nbEk0+LSUbUm +KX8Qm00wDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgNIADBFAiEAnPAAhAxVVf8v +4hdnM8l6z1zHgoq9kEP9esMeuZ85B1ACIEotYXlm+ECh3dhzjHb0ef38c9ao//1w +5ECQKTWeWeqS +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/key.pem new file mode 100644 index 0000000..03bf8b5 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime256v1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIDGQzJBv1o5loyF0p7kYFFegueeBuepCnnfUGnLg3wpeoAoGCCqGSM49 +AwEHoUQDQgAEq4RHf/AUVch0shHHz4ETr2xB8gQASiBJExIJUkdh0ST6FF5V5Nj6 +bLHqT2v8TPwWKM+E7/Hhddzm/y74RtacKA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert.pem new file mode 100644 index 0000000..d198d70 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICdTCCAhugAwIBAgIJAIkfZlZb1VAbMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MDcxMFoXDTIwMTEyMTE1MDcxMFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAASrhEd/8BRVyHSyEcfPgROvbEHyBABKIEkTEglSR2HR +JPoUXlXk2PpssepPa/xM/BYoz4Tv8eF13Ob/LvhG1pwoo1AwTjAdBgNVHQ4EFgQU +T2yhjYW/nbEk0+LSUbUmKX8Qm00wHwYDVR0jBBgwFoAUT2yhjYW/nbEk0+LSUbUm +KX8Qm00wDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgNIADBFAiEAnPAAhAxVVf8v +4hdnM8l6z1zHgoq9kEP9esMeuZ85B1ACIEotYXlm+ECh3dhzjHb0ef38c9ao//1w +5ECQKTWeWeqS +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha256.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha256.pem new file mode 100644 index 0000000..a6eddd4 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha256.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICdDCCAhugAwIBAgIJAJFFEyaq0CtjMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyNTE1NDExMloXDTIwMTEyNDE1NDExMlowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAASrhEd/8BRVyHSyEcfPgROvbEHyBABKIEkTEglSR2HR +JPoUXlXk2PpssepPa/xM/BYoz4Tv8eF13Ob/LvhG1pwoo1AwTjAdBgNVHQ4EFgQU +T2yhjYW/nbEk0+LSUbUmKX8Qm00wHwYDVR0jBBgwFoAUT2yhjYW/nbEk0+LSUbUm +KX8Qm00wDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgNHADBEAiBAf9B5Uc/iLNpv +dHy12J6t1Z0QZ9+tSyb9hLuUIh7vWgIgUUC3P0/8ATrWOicl7cuyY/dw/FZuuRMo +aExLyrL5B4s= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha384.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha384.pem new file mode 100644 index 0000000..957683e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha384.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICdDCCAhugAwIBAgIJAKIBNSFRktFKMAoGCCqGSM49BAMDMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyNTE1NDEzN1oXDTIwMTEyNDE1NDEzN1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAASrhEd/8BRVyHSyEcfPgROvbEHyBABKIEkTEglSR2HR +JPoUXlXk2PpssepPa/xM/BYoz4Tv8eF13Ob/LvhG1pwoo1AwTjAdBgNVHQ4EFgQU +T2yhjYW/nbEk0+LSUbUmKX8Qm00wHwYDVR0jBBgwFoAUT2yhjYW/nbEk0+LSUbUm +KX8Qm00wDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAwNHADBEAiBb0l00mw+CdHcv +RkfHzrzJpkFPfqkF5GXUuH9DW2JzxAIgOnWBrh2i627vF0I5W1kyzNr467KfIBoB +7aaK4tnINMM= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha512.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha512.pem new file mode 100644 index 0000000..008f0be --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/cert_sha512.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICdDCCAhugAwIBAgIJANupPIXMt1lnMAoGCCqGSM49BAMEMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyNTE1NDIwNFoXDTIwMTEyNDE1NDIwNFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAASrhEd/8BRVyHSyEcfPgROvbEHyBABKIEkTEglSR2HR +JPoUXlXk2PpssepPa/xM/BYoz4Tv8eF13Ob/LvhG1pwoo1AwTjAdBgNVHQ4EFgQU +T2yhjYW/nbEk0+LSUbUmKX8Qm00wHwYDVR0jBBgwFoAUT2yhjYW/nbEk0+LSUbUm +KX8Qm00wDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDBANHADBEAiBWvELNS7izFw4A +XDpNJq/+tQ6WbefKx5P4W2/Ra7+MZAIgPHtOzNWlHQhoOrd7Wq9CZb8wPHy/QP1Y +HMXzAMhFKgQ= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/key.pem new file mode 100644 index 0000000..03bf8b5 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/prime_test/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIDGQzJBv1o5loyF0p7kYFFegueeBuepCnnfUGnLg3wpeoAoGCCqGSM49 +AwEHoUQDQgAEq4RHf/AUVch0shHHz4ETr2xB8gQASiBJExIJUkdh0ST6FF5V5Nj6 +bLHqT2v8TPwWKM+E7/Hhddzm/y74RtacKA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/cert.pem new file mode 100644 index 0000000..b96ab7e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICKjCCAfSgAwIBAgIJANoDW6czwhCjMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0MzkzN1oXDTIwMTEyMTE0MzkzN1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wMjAQBgcqhkjO +PQIBBgUrgQQABgMeAAQ/jXT36fsiDdh/5OBMhhsvbvwvcYnlNT0HvgwYo1AwTjAd +BgNVHQ4EFgQUxY6LhoTkK1rM6qH8fEZEbr/kgwkwHwYDVR0jBBgwFoAUxY6LhoTk +K1rM6qH8fEZEbr/kgwkwDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgMkADAhAg8A +j1+cJc4E9cykFcdksEgCDibOb7uxYlRLlRRjlQYF +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/key.pem new file mode 100644 index 0000000..5b3fc14 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MD4CAQEEDnfC7Feqbvn+7pTg6ItUoAcGBSuBBAAGoSADHgAEP4109+n7Ig3Yf+Tg +TIYbL278L3GJ5TU9B74MGA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/cert.pem new file mode 100644 index 0000000..da3571e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICKTCCAfSgAwIBAgIJAN02Y1/xUOcTMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIc2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDExNloXDTIwMTEyMTE0NDExNlowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhzZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wMjAQBgcqhkjO +PQIBBgUrgQQABwMeAATXH2nLiDcPNHom7JnSLs4+4w/TjBqJNzs38B92o1AwTjAd +BgNVHQ4EFgQU/eijGeA5tQtm6Alw/Q5lsLO4EXowHwYDVR0jBBgwFoAU/eijGeA5 +tQtm6Alw/Q5lsLO4EXowDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgMjADAgAg4Z +iYyBMkuTQRNvrjwyfQIOIcIQIYBVmYw+Q7W/S4E= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/key.pem new file mode 100644 index 0000000..810c4e4 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp112r2/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MD4CAQEEDjDrkz+2aA4NAe7JC7rVoAcGBSuBBAAHoSADHgAE1x9py4g3DzR6JuyZ +0i7OPuMP04waiTc7N/Afdg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/cert.pem new file mode 100644 index 0000000..cd615c0 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICMjCCAfigAwIBAgIJAI2wNupDNRFZMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDIyNFoXDTIwMTEyMTE0NDIyNFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wNjAQBgcqhkjO +PQIBBgUrgQQAHAMiAAR/v87xXJvdssAfKfc9n8MLfiWeXaiNu+uFBKpo9AsCZaNQ +ME4wHQYDVR0OBBYEFPePs/AV6GkKZUN8GtYIxXEO1sQeMB8GA1UdIwQYMBaAFPeP +s/AV6GkKZUN8GtYIxXEO1sQeMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDKAAw +JQIRAK89UVs/42K9r5WAgTXsL2QCEBs+Xd7hNm7c1sBuRS+a3ZQ= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/key.pem new file mode 100644 index 0000000..92e7d9f --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MEQCAQEEEG9x4bBg7KZizdpHFjcfeVegBwYFK4EEAByhJAMiAAR/v87xXJvdssAf +Kfc9n8MLfiWeXaiNu+uFBKpo9AsCZQ== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/cert.pem new file mode 100644 index 0000000..47caff0 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICMTCCAfigAwIBAgIJAIU74rujRO+7MAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIc2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDQwM1oXDTIwMTEyMTE0NDQwM1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhzZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wNjAQBgcqhkjO +PQIBBgUrgQQAHQMiAATz7jT6U4WJan1IlIIdsYl+itgerLWbH3r3xbTwYWSQNqNQ +ME4wHQYDVR0OBBYEFKfUsmwsM2HVh7sJnUAjzaLjxyvYMB8GA1UdIwQYMBaAFKfU +smwsM2HVh7sJnUAjzaLjxyvYMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDJwAw +JAIQLkfxRgVr4RtYFhKpP1coDQIQPgTCwMEbiW7O3siC4W8qlw== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/key.pem new file mode 100644 index 0000000..6ea70a8 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp128r2/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MEQCAQEEECsHYxweJUATsIOd/m94GgqgBwYFK4EEAB2hJAMiAATz7jT6U4WJan1I +lIIdsYl+itgerLWbH3r3xbTwYWSQNg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/cert.pem new file mode 100644 index 0000000..2c58464 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICQTCCAgCgAwIBAgIJAJvQr/6Kn9AEMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDUwOFoXDTIwMTEyMTE0NDUwOFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wPjAQBgcqhkjO +PQIBBgUrgQQACQMqAAQLEJm85r9f32zEdedxEK6ji8N5E6tOgiSHpGhQ9BsKeOtJ +BzSYH/Rko1AwTjAdBgNVHQ4EFgQU+8wQoti+XNwIJTiyYzNVfg7eEbkwHwYDVR0j +BBgwFoAU+8wQoti+XNwIJTiyYzNVfg7eEbkwDAYDVR0TBAUwAwEB/zAKBggqhkjO +PQQDAgMvADAsAhRH2d9QVUSWbfg4WLrbBXXEsG52VwIUWkK0u60A9xtyHmDnqiMi +t9ru3Ng= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/key.pem new file mode 100644 index 0000000..a0ec571 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160k1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MFACAQEEFHLvqf4Fxc7ONdu89tS75oTglJEAoAcGBSuBBAAJoSwDKgAECxCZvOa/ +X99sxHXncRCuo4vDeROrToIkh6RoUPQbCnjrSQc0mB/0ZA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/cert.pem new file mode 100644 index 0000000..c0a68da --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICQjCCAgCgAwIBAgIJAJH8eIiMmt3iMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDU1NVoXDTIwMTEyMTE0NDU1NVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wPjAQBgcqhkjO +PQIBBgUrgQQACAMqAAQLyCGikpfFhiSU+oUv2UfLILPXnWXYmV5gQRIH1E49tJQ9 +GWPgU0TUo1AwTjAdBgNVHQ4EFgQUfP5XUebPcxDkenyF4vEjREMICmYwHwYDVR0j +BBgwFoAUfP5XUebPcxDkenyF4vEjREMICmYwDAYDVR0TBAUwAwEB/zAKBggqhkjO +PQQDAgMwADAtAhRVZXNgG/OopCO2gRHWq3Aw+mJ1wgIVAN4E243JYvle5gZkVjQ6 +0rhvrswQ +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/key.pem new file mode 100644 index 0000000..1dee63d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MFACAQEEFGOJdxxxONgAj8rU9oTDJM+1xpEwoAcGBSuBBAAIoSwDKgAEC8ghopKX +xYYklPqFL9lHyyCz151l2JleYEESB9ROPbSUPRlj4FNE1A== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/cert.pem new file mode 100644 index 0000000..437df1a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICQzCCAgCgAwIBAgIJAPaJd1XqjJ4uMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDY1MloXDTIwMTEyMTE0NDY1MlowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wPjAQBgcqhkjO +PQIBBgUrgQQAHgMqAAQpQVfllcmAmd0EqO6sXPZqwHfbS4sJ3VDa22nP68QSYk3d +lJ+ucSmlo1AwTjAdBgNVHQ4EFgQUyYCINnSzVVVf7nwnpKSh491bePQwHwYDVR0j +BBgwFoAUyYCINnSzVVVf7nwnpKSh491bePQwDAYDVR0TBAUwAwEB/zAKBggqhkjO +PQQDAgMxADAuAhUA8GBT9KxSoo/g3nL8MPpHn3lKx6UCFQDXplm5HAz0zJBkn0g/ +gmW4JSSR6Q== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/key.pem new file mode 100644 index 0000000..6a365a5 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp160r2/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MFACAQEEFOqovvoy9zGigVBu93rIAxYAKMihoAcGBSuBBAAeoSwDKgAEKUFX5ZXJ +gJndBKjurFz2asB320uLCd1Q2ttpz+vEEmJN3ZSfrnEppQ== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/cert.pem new file mode 100644 index 0000000..57f3ba7 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICUjCCAgigAwIBAgIJANxj/oGgJ707MAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDc1NFoXDTIwMTEyMTE0NDc1NFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wRjAQBgcqhkjO +PQIBBgUrgQQAHwMyAASjP8fet2r3Ax0C7T8oNTFx7i4F+nAoQnSp0A4G38O9wqJb +0hDT7oeQs6/iiO2kXVSjUDBOMB0GA1UdDgQWBBQIMkaTAcQvn21tTR99e7wan48x +JDAfBgNVHSMEGDAWgBQIMkaTAcQvn21tTR99e7wan48xJDAMBgNVHRMEBTADAQH/ +MAoGCCqGSM49BAMCAzgAMDUCGHCo2k64qybPwSjWSQIWiGN837fquCRexgIZAKyE +hsl/zYrVlzAgMbt4Qaxfsc3pkCKCQg== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/key.pem new file mode 100644 index 0000000..0d87c9e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp192k1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MFwCAQEEGEvH7flbJYwRGSpW5Qb9L1QTc1rwGQQzcqAHBgUrgQQAH6E0AzIABKM/ +x963avcDHQLtPyg1MXHuLgX6cChCdKnQDgbfw73ColvSENPuh5Czr+KI7aRdVA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/cert.pem new file mode 100644 index 0000000..a542728 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICYTCCAhCgAwIBAgIJALJNvSLpCWRaMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NDg0N1oXDTIwMTEyMTE0NDg0N1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wTjAQBgcqhkjO +PQIBBgUrgQQAIAM6AARtlgnnpFXkUZb2RyNFzhvrvZtERFdWdmvl1gYM6OnOTGt8 +XJ9GhGV5ZB7l5D87HMgnodtFAQGsfKNQME4wHQYDVR0OBBYEFIWzauR5vkw8KfU8 +PvcA6ymopOBDMB8GA1UdIwQYMBaAFIWzauR5vkw8KfU8PvcA6ymopOBDMAwGA1Ud +EwQFMAMBAf8wCgYIKoZIzj0EAwIDPwAwPAIcHWOdtOdNa4UeXZF6mpFgN9+OQ/0F +A88TjQoyuQIcS8pFpDjFBcqvg3sNQC2/kAiZstKluUecgTiTqQ== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/key.pem new file mode 100644 index 0000000..79ad442 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224k1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MGgCAQEEHJIv5O4agM+/PUqRvFbUsLOmvV6r04pV8dhsklKgBwYFK4EEACChPAM6 +AARtlgnnpFXkUZb2RyNFzhvrvZtERFdWdmvl1gYM6OnOTGt8XJ9GhGV5ZB7l5D87 +HMgnodtFAQGsfA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/cert.pem new file mode 100644 index 0000000..2ef1307 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICYzCCAhCgAwIBAgIJAN4gvru+0uLmMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NTAwMFoXDTIwMTEyMTE0NTAwMFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wTjAQBgcqhkjO +PQIBBgUrgQQAIQM6AAQpxUjbbBKK0rQj3AKSMtPuZyonJVCGJgIM+bHwFNjvDkyn +6c1RUzzt9ov3aav0vEMImIvfNKNA36NQME4wHQYDVR0OBBYEFNMbbqagCEI02eI+ +dBZIy13PDg71MB8GA1UdIwQYMBaAFNMbbqagCEI02eI+dBZIy13PDg71MAwGA1Ud +EwQFMAMBAf8wCgYIKoZIzj0EAwIDQQAwPgIdAI7PXFlm4E4OnXSRW9TpIZHtYuOE +2vndHyyXhjUCHQDVFQe8ZmFdRBzcAt+XvstfcL1w9PhFrWd64gdd +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/key.pem new file mode 100644 index 0000000..44bf9c6 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp224r1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MGgCAQEEHL9OzgYSV+mjLmMzO4lIT3qq5LwnNVz75IrUNxWgBwYFK4EEACGhPAM6 +AAQpxUjbbBKK0rQj3AKSMtPuZyonJVCGJgIM+bHwFNjvDkyn6c1RUzzt9ov3aav0 +vEMImIvfNKNA3w== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/cert.pem new file mode 100644 index 0000000..2f9213a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICczCCAhigAwIBAgIJAN0eDgzuE3Q+MAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NTEyOVoXDTIwMTEyMTE0NTEyOVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wVjAQBgcqhkjO +PQIBBgUrgQQACgNCAASbHtnkBpXWOCmdEtm9lcm8gu4Xf2CVNeOcLzXXSNrfF7Y4 +c/B5igk2a2CeJvZjvRoPuwRHwSPGrx69+nOvV4Uto1AwTjAdBgNVHQ4EFgQU81Xs +n+jRqAagYRgyAW6//+Q5NSIwHwYDVR0jBBgwFoAU81Xsn+jRqAagYRgyAW6//+Q5 +NSIwDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgNJADBGAiEAgVvjyi1awrmm3hn8 +10V9ayuiN+YwKcz3ptdP/3SRtpsCIQCsoD/mGQ1EB+zlLxWKlSJKTwQZqgX1DjlY +v8PqnkOGYw== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/key.pem new file mode 100644 index 0000000..08413d6 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp256k1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHQCAQEEIIMO7rs2rgAnlbhHK6nYgliJtPywbvGjkQM0FV9dB7ZwoAcGBSuBBAAK +oUQDQgAEmx7Z5AaV1jgpnRLZvZXJvILuF39glTXjnC8110ja3xe2OHPweYoJNmtg +nib2Y70aD7sER8Ejxq8evfpzr1eFLQ== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/cert.pem new file mode 100644 index 0000000..615c9ec --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/cert.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICsjCCAjigAwIBAgIJAOA2ufFH/f0PMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NTIyNVoXDTIwMTEyMTE0NTIyNVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wdjAQBgcqhkjO +PQIBBgUrgQQAIgNiAATae08yJKjgrKezOWFrYla81C+p8BGu7k1bwKPJSs5tqFVk +WLSuY18YBY2j0WGyqDU4ZgxgoFEtR4FJ0pVbepH1lmbzg5GJK7oDOzBvQHN9btp7 +3FFhdLvY6KvI9bX/iPWjUDBOMB0GA1UdDgQWBBRfFM2YaATdppf2Z2lMfcBsaLZZ +azAfBgNVHSMEGDAWgBRfFM2YaATdppf2Z2lMfcBsaLZZazAMBgNVHRMEBTADAQH/ +MAoGCCqGSM49BAMCA2gAMGUCMBf0N3wKHoId9P5vi6eYBHwiFmxI7wdk62GQHH8e +egzXXfC6K7Oz0qsEsW//HbARvwIxAOt+jRsgzlPznaQ5QlT8OI1yjHggYUFZMG14 +AtFmnlAB9Vcd1qAll/Ldde8yjEwSQQ== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/key.pem new file mode 100644 index 0000000..7522e9e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp384r1/key.pem @@ -0,0 +1,6 @@ +-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDBcgw54gCpUOZaiwzTn0harkndq+yamzj0h2iMLszg1uYDGPtCK2MLM ++0OtZdOOsQ6gBwYFK4EEACKhZANiAATae08yJKjgrKezOWFrYla81C+p8BGu7k1b +wKPJSs5tqFVkWLSuY18YBY2j0WGyqDU4ZgxgoFEtR4FJ0pVbepH1lmbzg5GJK7oD +OzBvQHN9btp73FFhdLvY6KvI9bX/iPU= +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/cert.pem new file mode 100644 index 0000000..03368c1 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIC/TCCAl6gAwIBAgIJANrhA1igCab0MAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE0NTMyM1oXDTIwMTEyMTE0NTMyM1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgZswEAYHKoZI +zj0CAQYFK4EEACMDgYYABAFIrNa9taEbntNUmN+0T2hXJPLXrIAFYM1OQyafX1LU +ymjJn9ckveDBWX+xuZU4MXedMFi3Pnrahmxv4KmsvFVpYABI7tSQnrpP89AAIhT5 +JUYXqD/rTV5wR8Wi5f/Bfv3kGTc1jkRZgsXx2B6lhNTADLQhC7FoIgYtM/iog3Mk +MhrNRqNQME4wHQYDVR0OBBYEFIcdUC0QZJCOYsZ5JSIkKCKRp47pMB8GA1UdIwQY +MBaAFIcdUC0QZJCOYsZ5JSIkKCKRp47pMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0E +AwIDgYwAMIGIAkIBKcuPAkfghz8XzMVzSiHtl6Iyry1qoOu+QSbKpzPCUBXdCKim +M9cX5m6QZjAHbBT/g+7RMBRKMFnL40nx7vqfCdgCQgGBvFxW0vHpGEW5GddT4nqu +Dt2mWTe3oj8gJN1HVG8ZR+ynyxZp0/ej5CsSGreUKmz4Dkk5JQvrTbJIH28My9GO +fg== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/key.pem new file mode 100644 index 0000000..72c7513 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/secp521r1/key.pem @@ -0,0 +1,7 @@ +-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIBSzfdYfFF7DOL+FCvnczjBdOa877Y5oLQ1wdMPYTGFw6GCfAvHO4/ +SJ8lpGE6gPHtYBE69amMhghrtzrrtwjRAkugBwYFK4EEACOhgYkDgYYABAFIrNa9 +taEbntNUmN+0T2hXJPLXrIAFYM1OQyafX1LUymjJn9ckveDBWX+xuZU4MXedMFi3 +Pnrahmxv4KmsvFVpYABI7tSQnrpP89AAIhT5JUYXqD/rTV5wR8Wi5f/Bfv3kGTc1 +jkRZgsXx2B6lhNTADLQhC7FoIgYtM/iog3MkMhrNRg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/cert.pem new file mode 100644 index 0000000..6635252 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICLDCCAfagAwIBAgIJAL5sKl7Iq8jkMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MDgwNloXDTIwMTEyMTE1MDgwNlowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wNDAQBgcqhkjO +PQIBBgUrgQQABAMgAAQBEpYAjSZ9OQLSAO/vaqkBjv0f0Q5CwjvfjAedBmijUDBO +MB0GA1UdDgQWBBQIsI5HcJVN0ZHGx3aM5UHoUN7UmTAfBgNVHSMEGDAWgBQIsI5H +cJVN0ZHGx3aM5UHoUN7UmTAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCAyQAMCEC +Dn7E4/gSNWOLefIp8MKeAg8Aiot3vwQj3xu28d0DjbQ= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/key.pem new file mode 100644 index 0000000..9cc2a50 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MEECAQEEDwAwtkZqc/5nr/PCe97A1qAHBgUrgQQABKEiAyAABAESlgCNJn05AtIA +7+9qqQGO/R/RDkLCO9+MB50GaA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/cert.pem new file mode 100644 index 0000000..c6daef8 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICKzCCAfagAwIBAgIJAMNN6I9Pgx7tMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MDg1N1oXDTIwMTEyMTE1MDg1N1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wNDAQBgcqhkjO +PQIBBgUrgQQABQMgAAQA3h7Lgx9NCHgBNaZriz0AFuAYhDucrO0SDJ+OWgqjUDBO +MB0GA1UdDgQWBBRMr+I8KUs2DBVsEY0U3Geojo+nxTAfBgNVHSMEGDAWgBRMr+I8 +KUs2DBVsEY0U3Geojo+nxTAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCAyMAMCAC +DhTJ0XX2cvmqM1qqGSM8Ag4GMO1fVxxNAQ6ZW6iPlw== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/key.pem new file mode 100644 index 0000000..7cf6c7f --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect113r2/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MEECAQEEDwDiFe3sPBeN9onjAAhYdKAHBgUrgQQABaEiAyAABADeHsuDH00IeAE1 +pmuLPQAW4BiEO5ys7RIMn45aCg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/cert.pem new file mode 100644 index 0000000..f4bac31 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICNTCCAfqgAwIBAgIJANNcx1nzXZLWMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTAxOFoXDTIwMTEyMTE1MTAxOFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wODAQBgcqhkjO +PQIBBgUrgQQAFgMkAAQCcOcbzeJwOSCTTvyK0Z2GkgTm3EY7aBUycoOBPawtRDhy +o1AwTjAdBgNVHQ4EFgQUwFMGKdRexG0/u7nTHw5050Qh0n0wHwYDVR0jBBgwFoAU +wFMGKdRexG0/u7nTHw5050Qh0n0wDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgMp +ADAmAhEB3KkGwm/YMhYm+MpD1TavxgIRAiQBTlFeTnay2NHmpK7hmzE= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/key.pem new file mode 100644 index 0000000..ba133cd --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MEcCAQEEEQBOAyh6q3g/f9sFVsKog5RUoAcGBSuBBAAWoSYDJAAEAnDnG83icDkg +k078itGdhpIE5txGO2gVMnKDgT2sLUQ4cg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/cert.pem new file mode 100644 index 0000000..d9c5a3d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICNTCCAfqgAwIBAgIJANJ93q3SQtXBMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTExN1oXDTIwMTEyMTE1MTExN1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wODAQBgcqhkjO +PQIBBgUrgQQAFwMkAAQCydPn7i1Lhr49TTFrj1nNoQQ+DRDvlu8dIFGOxCpY6MNu +o1AwTjAdBgNVHQ4EFgQUiDYSpxQhTNV4+egsyOBlj28ADhEwHwYDVR0jBBgwFoAU +iDYSpxQhTNV4+egsyOBlj28ADhEwDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAgMp +ADAmAhECD9yv8NJ2NXNs1L2CflgIlQIRA6jhfCKDO2+aH+GJ4aIKwyI= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/key.pem new file mode 100644 index 0000000..c04e84b --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect131r2/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MEcCAQEEEQGitFeh/q5Bd6Fl0spJATLXoAcGBSuBBAAXoSYDJAAEAsnT5+4tS4a+ +PU0xa49ZzaEEPg0Q75bvHSBRjsQqWOjDbg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/cert.pem new file mode 100644 index 0000000..e0ea053 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICRTCCAgKgAwIBAgIJAMpwQdqL0//YMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTIyM1oXDTIwMTEyMTE1MTIyM1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wQDAQBgcqhkjO +PQIBBgUrgQQAAQMsAAQBBX+LfbEN3kjzQI0yDAVfXvZ5JP0D3SNSoJFvIFna9Kmo +rQBk3xrznKyjUDBOMB0GA1UdDgQWBBQ6ZLIH+eDn2Srt67oMvHGi+CVT8TAfBgNV +HSMEGDAWgBQ6ZLIH+eDn2Srt67oMvHGi+CVT8TAMBgNVHRMEBTADAQH/MAoGCCqG +SM49BAMCAzEAMC4CFQIaF/tE/zZUim/u1vmMQlKyiDeEQAIVAs3dJwTIMu5QSRDl +2md4d61sgUO2 +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/key.pem new file mode 100644 index 0000000..7f2b6f7 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163k1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MFMCAQEEFQMaGNiMTTaHkdQnlq5G2kgtKRDk06AHBgUrgQQAAaEuAywABAEFf4t9 +sQ3eSPNAjTIMBV9e9nkk/QPdI1KgkW8gWdr0qaitAGTfGvOcrA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/cert.pem new file mode 100644 index 0000000..071d01a --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICRTCCAgKgAwIBAgIJAIC8+09qOXM2MAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTMxM1oXDTIwMTEyMTE1MTMxM1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wQDAQBgcqhkjO +PQIBBgUrgQQAAgMsAAQFpP35QxbjDHe1kPszsnSjaL+tRFYFZW8RjhqrgizMpHeL +WfMUH0QNmM6jUDBOMB0GA1UdDgQWBBSk2iggGMFDKY/7T2f+MV59VMlnXjAfBgNV +HSMEGDAWgBSk2iggGMFDKY/7T2f+MV59VMlnXjAMBgNVHRMEBTADAQH/MAoGCCqG +SM49BAMCAzEAMC4CFQCSAsb2jcsuDpr5W6EnzPxKadt4lQIVAvxzmJ7ikMmzigHf +7FBKYA+8xSo3 +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/key.pem new file mode 100644 index 0000000..a0b2856 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r1/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MFMCAQEEFQBEnygypbtFl7xgroFi/mVboaq2Q6AHBgUrgQQAAqEuAywABAWk/flD +FuMMd7WQ+zOydKNov61EVgVlbxGOGquCLMykd4tZ8xQfRA2Yzg== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/cert.pem new file mode 100644 index 0000000..612441d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICRTCCAgKgAwIBAgIJAJFNe3QpRjZmMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTQwMFoXDTIwMTEyMTE1MTQwMFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wQDAQBgcqhkjO +PQIBBgUrgQQADwMsAAQDEza9nc8/IUYau8pWdRy7tG7Ck20DEUNxjH6h+pOdlHWF +fpSTrIv48zijUDBOMB0GA1UdDgQWBBQeepan2NkEHH6TY559jbjV9xLrdjAfBgNV +HSMEGDAWgBQeepan2NkEHH6TY559jbjV9xLrdjAMBgNVHRMEBTADAQH/MAoGCCqG +SM49BAMCAzEAMC4CFQN+SQM1YCoMTMHXw4BO/149IkIhXgIVASXZ2wQ9NxFFvhYe +RD/zGsmg7yJV +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/key.pem new file mode 100644 index 0000000..a34c229 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect163r2/key.pem @@ -0,0 +1,4 @@ +-----BEGIN EC PRIVATE KEY----- +MFMCAQEEFQPZFl1yy3/pJlhIcNZaZOFijgsOg6AHBgUrgQQAD6EuAywABAMTNr2d +zz8hRhq7ylZ1HLu0bsKTbQMRQ3GMfqH6k52UdYV+lJOsi/jzOA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/cert.pem new file mode 100644 index 0000000..0ff9c2d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVDCCAgqgAwIBAgIJAIPN0o2PBrhtMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTQ1NVoXDTIwMTEyMTE1MTQ1NVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wSDAQBgcqhkjO +PQIBBgUrgQQAGAM0AAQA0JZLmrPHzELd7WVjNgfT8TogrvLOUldfANabpxYF8/eX +zthXSodu5kWi7ozH/UDg26NQME4wHQYDVR0OBBYEFKD5gPHdZrkmo/5/cSIt+x0w +AoHeMB8GA1UdIwQYMBaAFKD5gPHdZrkmo/5/cSIt+x0wAoHeMAwGA1UdEwQFMAMB +Af8wCgYIKoZIzj0EAwIDOAAwNQIZAJY0u7WJFAW/zqGOo60K/gmthXO1Gq1YYAIY +fzCXoCk/nq5PgqpeLb+mPpUH+6We2aZw +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/key.pem new file mode 100644 index 0000000..8d6c5d2 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MF8CAQEEGQDEpj0Addq/hksOJ5jyEUiB8tW3jW4Mym6gBwYFK4EEABihNgM0AAQA +0JZLmrPHzELd7WVjNgfT8TogrvLOUldfANabpxYF8/eXzthXSodu5kWi7ozH/UDg +2w== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/cert.pem new file mode 100644 index 0000000..e82bf07 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVDCCAgqgAwIBAgIJAIsy4po8nicaMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTU0NloXDTIwMTEyMTE1MTU0NlowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wSDAQBgcqhkjO +PQIBBgUrgQQAGQM0AAQBLDTOZYv87ZapRBUFnH8fnHidKXAJQjObADpiQOHnYrOW +Yu8Bi5hWbo81YbJYuuZRqKNQME4wHQYDVR0OBBYEFIjWyc9dRLeWWC1Xdxvy0/nf +WjJgMB8GA1UdIwQYMBaAFIjWyc9dRLeWWC1Xdxvy0/nfWjJgMAwGA1UdEwQFMAMB +Af8wCgYIKoZIzj0EAwIDOAAwNQIYYW8izB1yebPALdfGdrrpexkEtoUgrnfYAhkA +qEN64B8Uu4Sgyt2n5q1wdLIk0N7KGSVo +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/key.pem new file mode 100644 index 0000000..884b0ed --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect193r2/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MF8CAQEEGQCM6ZdxFCNYoZC6v/pFM9E9U+Ia5CWgiW6gBwYFK4EEABmhNgM0AAQB +LDTOZYv87ZapRBUFnH8fnHidKXAJQjObADpiQOHnYrOWYu8Bi5hWbo81YbJYuuZR +qA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/cert.pem new file mode 100644 index 0000000..eb907ad --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICZzCCAhSgAwIBAgIJAIqBAN/vykOnMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTY1OFoXDTIwMTEyMTE1MTY1OFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wUjAQBgcqhkjO +PQIBBgUrgQQAGgM+AAQAPQJFkJ85j1aDkOXUwBmqwxZtm1FFwfNuLLUSfT8Azkg5 +r8Sw4iOppUQBEYrvS/vX3QAW3rshbHbTi+GjUDBOMB0GA1UdDgQWBBQ9dFowA7MS +ek1kvlxFBhJyN6A20zAfBgNVHSMEGDAWgBQ9dFowA7MSek1kvlxFBhJyN6A20zAM +BgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0EAMD4CHTus0DMwtjp33sdqnvAFvhHX +LfK/bOpUdJesnyrQAh16OG8B82qSRmezAuYrIlb/lPxq46108IHAC3IJEg== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/key.pem new file mode 100644 index 0000000..e2198bc --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233k1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MG4CAQEEHgASBahnBzmUom0nHjtNYzDSBRAS17Ft+Wj5LYigu6AHBgUrgQQAGqFA +Az4ABAA9AkWQnzmPVoOQ5dTAGarDFm2bUUXB824stRJ9PwDOSDmvxLDiI6mlRAER +iu9L+9fdABbeuyFsdtOL4Q== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/cert.pem new file mode 100644 index 0000000..43207a1 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICaDCCAhSgAwIBAgIJAOZZczaUyKqZMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTc0OFoXDTIwMTEyMTE1MTc0OFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wUjAQBgcqhkjO +PQIBBgUrgQQAGwM+AAQAk8GNL6xAOg6Ej4ZjB5frkUsoiJiDJxaLZShuYdoBS1+3 +7ePxfktwHYIQb7k7PTeA3v8e/06dP3sTIeejUDBOMB0GA1UdDgQWBBRYWTfingrT ++TDrviIuvBa/HLh7dTAfBgNVHSMEGDAWgBRYWTfingrT+TDrviIuvBa/HLh7dTAM +BgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0IAMD8CHWbqCcCh1eVfPQhG55Z7JNLC +XbqaO/u4Q3nqrP9VAh4A0/0/3MFjbllIpZCi2+vrZZyQahsuJsFQThjJPUc= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/key.pem new file mode 100644 index 0000000..cfd5e53 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect233r1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MG4CAQEEHgBI7iWVrG26ChBOlrbDdAAapO+ze9kdq6vmqz3S3qAHBgUrgQQAG6FA +Az4ABACTwY0vrEA6DoSPhmMHl+uRSyiImIMnFotlKG5h2gFLX7ft4/F+S3AdghBv +uTs9N4De/x7/Tp0/exMh5w== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/cert.pem new file mode 100644 index 0000000..4f59e42 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICaTCCAhSgAwIBAgIJAJt5DxyKc44/MAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTgyOVoXDTIwMTEyMTE1MTgyOVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wUjAQBgcqhkjO +PQIBBgUrgQQAAwM+AAR3K2Do0rh9XhKuZMbhbftCleoC2SuxpVQjloQoagdjt0WM +K+7IC2Y/l0W66e3cvU7RhMNgxtQX8VbL0/ajUDBOMB0GA1UdDgQWBBQN+bCZYp93 +zSam3FJBjpJqoOD3azAfBgNVHSMEGDAWgBQN+bCZYp93zSam3FJBjpJqoOD3azAM +BgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0MAMEACHg9jdB/ZVaGB2HsLUCsubw9z +jcreyoOVPmQ8n/UINgIeFaCy3nPaOcK81k4KdL26M3xBLmbVpIEiN6M4QkOR +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/key.pem new file mode 100644 index 0000000..f1183a1 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect239k1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MG4CAQEEHgzxvbR4+m7TlLj1S4eHcATA0/55SVI7bzenQ3y2k6AHBgUrgQQAA6FA +Az4ABHcrYOjSuH1eEq5kxuFt+0KV6gLZK7GlVCOWhChqB2O3RYwr7sgLZj+XRbrp +7dy9TtGEw2DG1BfxVsvT9g== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/cert.pem new file mode 100644 index 0000000..e8bdec8 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICgTCCAiCgAwIBAgIJANV8vUHzt/gfMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MTkxN1oXDTIwMTEyMTE1MTkxN1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wXjAQBgcqhkjO +PQIBBgUrgQQAEANKAAQEt08NmTcK5jToT8DDxo2AC4wAjT9DihThZASWZNLaF5Ia +SDoH9LpfH0/18IJfhKkH9Q0iHhRdoyJ8Ys8LS6Ebp1omVZ/neOujUDBOMB0GA1Ud +DgQWBBSZ9eFeNdrsiKvABdOLIw1ZGO9hDTAfBgNVHSMEGDAWgBSZ9eFeNdrsiKvA +BdOLIw1ZGO9hDTAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA08AMEwCJAE468S8 +jL2CUspQnZjGuyV9YLOVDm9lJhpf3eETuRkiGp36wgIkAcIRD7hwu9mA879Zxyjo +57hduLsAInF9OKcVPvHef5NIIvw3 +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/key.pem new file mode 100644 index 0000000..8db20c0 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283k1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MIGAAgEBBCQABejkh9MyjuLMoB+4lhNsZY6zX4wPTaB/QMG6wiSvK3FY1NCgBwYF +K4EEABChTANKAAQEt08NmTcK5jToT8DDxo2AC4wAjT9DihThZASWZNLaF5IaSDoH +9LpfH0/18IJfhKkH9Q0iHhRdoyJ8Ys8LS6Ebp1omVZ/neOs= +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/cert.pem new file mode 100644 index 0000000..5ba16ec --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/cert.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICgTCCAiCgAwIBAgIJALD6GldxMmiwMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MjAwN1oXDTIwMTEyMTE1MjAwN1owgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wXjAQBgcqhkjO +PQIBBgUrgQQAEQNKAAQACZsqFUAt3up+IFvxm2FDO22HzStP7FMYuQFeikrM4vf3 +uTgABX2PafdR9olCgAg91yO4Lyx7hfWx+DOPQ4wXNRkSBHYwcGWjUDBOMB0GA1Ud +DgQWBBS6z8nzFc4Hk/D6qz2QK0JJNeGeXDAfBgNVHSMEGDAWgBS6z8nzFc4Hk/D6 +qz2QK0JJNeGeXDAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA08AMEwCJAIW8YoW +vjlCf3G16w04gXROim6P1Msh8pPp/cuoI6TWUonuUgIkALj8362+OsUO9GVmimag ++WnUOn45tFHNTC6xerBRou+XkWS6 +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/key.pem new file mode 100644 index 0000000..608524e --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect283r1/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MIGAAgEBBCQBKzqJvRt2A+mVHb8GBF43bh6GfwgcctW6C8uOgi1ADDbJHamgBwYF +K4EEABGhTANKAAQACZsqFUAt3up+IFvxm2FDO22HzStP7FMYuQFeikrM4vf3uTgA +BX2PafdR9olCgAg91yO4Lyx7hfWx+DOPQ4wXNRkSBHYwcGU= +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/cert.pem new file mode 100644 index 0000000..06e4508 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/cert.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICvzCCAkCgAwIBAgIJAIxgju4sd/azMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MjA1OFoXDTIwMTEyMTE1MjA1OFowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wfjAQBgcqhkjO +PQIBBgUrgQQAJANqAAQA8iSEjTOsbjMPlrxUzPFUP2kMlf/JP0OiB1rYyhuV7p0Z +CmdnEmxGAr9AKkznaC8hl6bOAVudYbsqzkiAcvrT1Rh5CFp7tRFF5XBjJPX8YYFW +lpb8qPDF6upAtcUl36iYHFHQ6jHWO6NQME4wHQYDVR0OBBYEFK+/ZwVR/A0TT9m4 +j4PEVNFAWRJ4MB8GA1UdIwQYMBaAFK+/ZwVR/A0TT9m4j4PEVNFAWRJ4MAwGA1Ud +EwQFMAMBAf8wCgYIKoZIzj0EAwIDbQAwagIzIaQU+0cJ/TuTlyUZVqjKtiIWH09q +aioQrosrAftXIGIpVMYZBgHN2YTWS4b1a+imFyfWAjMRuJMnSCfPj1AlVoJjsFsO +Xaho0SKTov+ztehutwwb9t/aJ7gHOKVlCxgobmPj+dTnCBM= +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/key.pem new file mode 100644 index 0000000..aa4769d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409k1/key.pem @@ -0,0 +1,6 @@ +-----BEGIN EC PRIVATE KEY----- +MIGwAgEBBDQAH3gL1ntP25XVN/bWZt57jYmM3NV2wyAiwv/G1P9CPTccP1Xqv6K6 +zqk0GipFIQimXxWToAcGBSuBBAAkoWwDagAEAPIkhI0zrG4zD5a8VMzxVD9pDJX/ +yT9Dogda2Moble6dGQpnZxJsRgK/QCpM52gvIZemzgFbnWG7Ks5IgHL609UYeQha +e7URReVwYyT1/GGBVpaW/KjwxerqQLXFJd+omBxR0Oox1js= +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/cert.pem new file mode 100644 index 0000000..26f8cdd --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/cert.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICwTCCAkCgAwIBAgIJAO8zvhu+v30cMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MjEzOVoXDTIwMTEyMTE1MjEzOVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wfjAQBgcqhkjO +PQIBBgUrgQQAJQNqAAQAu4xR12zwPwAKjXSrdc7BrTa5C7mlmQFZjEzqqba/XD/4 +0CcGEjgB9AzKDHQx6xcABPohAKe3FpbgMnSbJIJbSSDbnzoKe4/pJ7a2ACi8Bq1l +LoZ2ywoUtfCNE6ldBt5vfhikO6uQs6NQME4wHQYDVR0OBBYEFIr2tnPESanqmgUB +2ecoFU9P9HN6MB8GA1UdIwQYMBaAFIr2tnPESanqmgUB2ecoFU9P9HN6MAwGA1Ud +EwQFMAMBAf8wCgYIKoZIzj0EAwIDbwAwbAI0AJO4gQQfXQw6zM9TpKYPUkhroAgz +OWtzwaamlld2OGYxr1vY2grZMzY91a4e5cpBAGFNWAI0AKSgtJYkF0ZMS7XpD2C8 +AYYl7QCQy1YAcOEkTQsiqhB7i+7NEKsiORN03CnIfAjE17C0cg== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/key.pem new file mode 100644 index 0000000..b733ba4 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect409r1/key.pem @@ -0,0 +1,6 @@ +-----BEGIN EC PRIVATE KEY----- +MIGwAgEBBDQAgwlj663GE4leq0+5kAqqJNymWK2sRyksL9XCWBdgAcpmWrHytnK0 +PaEJ1FZ4HQpb/vGKoAcGBSuBBAAloWwDagAEALuMUdds8D8ACo10q3XOwa02uQu5 +pZkBWYxM6qm2v1w/+NAnBhI4AfQMygx0MesXAAT6IQCntxaW4DJ0mySCW0kg2586 +CnuP6Se2tgAovAatZS6GdssKFLXwjROpXQbeb34YpDurkLM= +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/cert.pem new file mode 100644 index 0000000..1bb74c9 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDFDCCAmqgAwIBAgIJAO5isZpzwq0dMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MjIzOVoXDTIwMTEyMTE1MjIzOVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgacwEAYHKoZI +zj0CAQYFK4EEACYDgZIABAI/yZpA7k9SCuiq4l42FycKEMJPuBtk3fa5lRkXUJPY +3HYrf6IclGgtbxvJxemsHfZpTL/88IcZ7W13avfTzbUe/SkPyz6BnAN+G+Vj74sP +VtFxbjvLtZ3gVe7jH7wLN3xGbKWbNjPLu+zxPk0HvnXccWdcflzod3YNvv3aCLXW +CpELlEFKY+OqvRUDf5YoJKNQME4wHQYDVR0OBBYEFBlZP+ipOQyOg6HKfHjtkEaG +jS7WMB8GA1UdIwQYMBaAFBlZP+ipOQyOg6HKfHjtkEaGjS7WMAwGA1UdEwQFMAMB +Af8wCgYIKoZIzj0EAwIDgZcAMIGTAkdAUFf1pnqP3k9TOLCLiXgQLsLovjYXwhut +NP1vqjYxc+Cb/WVgM3fyhzjMEnUMWPydInksxc01LzWNnPtxDa25FnYhQS4DzAJI +AV1RL/d8ibEVd2kFkZCrZq+riLTSMLhkMwz6vubQxYT1cfE8AdpwcwkOBYAdk3/x +4s01ujQ9+XLG1n2Dbrdm2gLIq1IwS57K +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/key.pem new file mode 100644 index 0000000..3a55c59 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571k1/key.pem @@ -0,0 +1,8 @@ +-----BEGIN EC PRIVATE KEY----- +MIHuAgEBBEgA09UA3ggw+ZNqcN5vp3s2fog/jlatxRo/W+fOOiZrTpgYBFZBhuBZ +ssXI1Z733oHBO7t0aXGNV2qo+SISTZovbxrT+imWIdCgBwYFK4EEACahgZUDgZIA +BAI/yZpA7k9SCuiq4l42FycKEMJPuBtk3fa5lRkXUJPY3HYrf6IclGgtbxvJxems +HfZpTL/88IcZ7W13avfTzbUe/SkPyz6BnAN+G+Vj74sPVtFxbjvLtZ3gVe7jH7wL +N3xGbKWbNjPLu+zxPk0HvnXccWdcflzod3YNvv3aCLXWCpELlEFKY+OqvRUDf5Yo +JA== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/cert.pem new file mode 100644 index 0000000..f274f6d --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDFTCCAmqgAwIBAgIJAIO4gLeiOi9wMAoGCCqGSM49BAMCMIGWMQswCQYDVQQG +EwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRlbzEQ +MA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNn +cmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMB4X +DTIwMTAyMjE1MjMxOVoXDTIwMTEyMTE1MjMxOVowgZYxCzAJBgNVBAYTAlVZMRMw +EQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYDVQQK +DAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1wb25l +MSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgacwEAYHKoZI +zj0CAQYFK4EEACcDgZIABAaB/iQNzfm6MEcBMWquifUlqufYZplpWqh9iDtajOCM +nz5LvuMwIvR67VopJaAiwl/Bksf/7lIJfc/2BPhDm53Sav8FfAdzBAKea/aIS32e +Tp2B4mi9AapNo/ursGivqo5HPPud3TEJJBb2c+j76Y0gxGgo5bnZcPrkvY/r8bKh +ATBr4ztP/qwKMYHBMVNloqNQME4wHQYDVR0OBBYEFJGLhQkxo1Zz/ZqedGtfVaG3 +Z7hvMB8GA1UdIwQYMBaAFJGLhQkxo1Zz/ZqedGtfVaG3Z7hvMAwGA1UdEwQFMAMB +Af8wCgYIKoZIzj0EAwIDgZgAMIGUAkgD2aD9CTGJr9RelvheunazWinfAZlkNsuA +3l6EoyiGRlwJirlkefQ/nStlZlRk2njk3XlyGkyi4RbNXVEecjAPg1kPin7HTZUC +SAD6ePPmRtGUHuNQLCqOdFleMdzcfnX6ArKJKsMLsjFGqseujJ/BcVvSVBgV/We1 +nHtoTgBSUc/AOT0kcAAXbdF4CULcpGUabQ== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/key.pem new file mode 100644 index 0000000..3f6646b --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/JWT_ECDSA/sect571r1/key.pem @@ -0,0 +1,8 @@ +-----BEGIN EC PRIVATE KEY----- +MIHuAgEBBEgCXHDz4dTad8p+tizZOA0cEycVU7jpfpBnrsZyDYR4LEdHy4FIDaoI +cShqCaC4zrnpxnRxtCQXiwIAZWPN0QIxtdJhekUs2kegBwYFK4EEACehgZUDgZIA +BAaB/iQNzfm6MEcBMWquifUlqufYZplpWqh9iDtajOCMnz5LvuMwIvR67VopJaAi +wl/Bksf/7lIJfc/2BPhDm53Sav8FfAdzBAKea/aIS32eTp2B4mi9AapNo/ursGiv +qo5HPPud3TEJJBb2c+j76Y0gxGgo5bnZcPrkvY/r8bKhATBr4ztP/qwKMYHBMVNl +og== +-----END EC PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.crt b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.crt new file mode 100644 index 0000000000000000000000000000000000000000..f8b70b5e7c11e85e1a9690e8dad04f3c2a291564 GIT binary patch literal 768 zcmXqLV)|py#FV;#nTe5!iIbtDl<$K2Q(F!LUN%mxHjlRNyo`*jtPBQ?(+s%{IN6v( zS=fY`LL&`@4Fo|P4jwMw{JfIXvdom!e3&3RilBf2A4nw^54(G6UTQ>Xv7w*=KS+d| zha)&OxwI&=q|#8xKma7f%)?onUX++yke`=osA8Z5cLOJ*m?&JvAsuK?MQO2Ka(=FX zoH(zMfq}V!g`tIsv8j0!kZTI$nnSsR*Wr!xk;9mgm4Ugj7Z}c+OpT2Ut6w~0Y3rleoYyA$B^pIbB(Wh&+>#_5{dzsy3YVPdhu$U5Sd0=YA z*6(SrQ|8Q2t=rW)(Xp~=>*}_RFUubZdOj|n`uI%Z+GCY3ll`^MD_qzx@2`Z&7QTbx be}ckdG`QBOyj`)AEhY4R?zJmnexEY{x7z{% literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.p12 b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha1_1024/sha1_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..7dbb9759c4d04ebcc5e7fd6377c3112c6f2c3b34 GIT binary patch literal 1789 zcmY+DX*Ao38i!>O32kk$7DZdFtrD)$Dq6H+OD(kwMHh{IX~!}eLHrG-mWrWMN{h5e zil`-u))F+vu0w3Gv~n4>)GjokSI@ck&b=Sr^Pcnk&ij7)JtzRS2L?e<0IUUu&`7dO z;vNMFfeHcGYbXFKKg1Li04e=Df)xUgoI{ii1_>Ol^uH4jN&zPP?+-^nFw`+994iqH zTu2a<0fXTJL;!N@Kmp=>l4&5jil^n(GtgUSIdZ=hx@L!?xh-cr=1M4^tNBQ|jdfvP zwelAO@QrVSn|jA(vk`mxe0H@=adh~RSGY3UF`w7uPRw=tbK$mcjt{W4`ozCF>Rxm7 zKTYcA5o*)R-EW_hw3^*2xjDRdpGv-XfSdGnZWnxC(*yJ9ve0LvDp9Pny7kBXHXgCI z0!#bID##cgNTF7Z33Xgqp=r3&W;lmmse`=x{wkex3G0Z~vt}sc6U{FPn&Ng@8?$Y0 zf{iH+-ub#@j+bQBnjx*87Iza_JLy!5f2PPVXXiR_I9};I9|R|B3TKutHmtGR3Nnia zVSN9>Ql8p0HJA}e6`9VH#~!%WOeaS2f*<)>3#1!pIVu~pnrbo23(gw{6}eZ8N;RTw zIsjN5)giYMFB`I01I1Ku!#`j3&2^t_1~0=b@xQKuMM)guk)U}}I>>w`> zOv`(kPOl6X2I8e;3;o_~32gH60sh8bg5IhyPO56_8&rEjHvdM&aVL!+1jFkgqK zumgwKZNK|q;U>A($O-(jogdel+J*E$bLB#8c^QJ4Jg`@}%WLk=a|Ws6i!u0w-ide* z4VNq>pdh)JjkY115amSPJC6*!u`TLkF2pHED|@&9DHfXisF%cUnozIzS6?cw*uF0e zo%ym9n~&=CeEYUTeJwhE=4W@1J442rva8wD6Vj^`|Br{wecYvxmBdpq@uISUKa<_X zHu>m|P~%%P&)|#a?PiP!>SAI-cPYtvVYQ=8zg~6N*4a=D%^RwuU>_6P##Ni9^&h6S zYX{#yy8joQ$~ZDM7jtGZN-JSNF}Pb};o@8&vG{9x`_N`zRbti`;mnkwXFyQBB`sZ5 zC3GQUg~PZ=SZvFv{UebcZI21>B4lI=FWILBPQ-1SEG>LcUS|qjQ7+1=gbqtuT`%bB zUA=Vt$Bn4X_7t~v2zRrbxuEH}xEB$vr_`o9d@%df&=M2@4Z0w2_(v+W!nIlSn1xif ze_tOQevfz895KJ%!@C{A8Re~{HyeN+!V-7qp-@&{eG&#cH}f=y87$lDt`*<0&yW%wZ}ZUuc=X za%|YSl?j)&?j|7XwCTXKYMoRF0RQ-gRtPI7rs|}Qwusr3?XX-gxg!&Au_iT{2Ky9BehgIkEQc zgV{5HYv6MFE|WXZg>lOxVM+YPIo6drvyYMI&gZ-pw0qpGtgS@A*OI-b=$Ai%(5F!+ z|J!PW6j~aJoV8V%^5Zu-C%G^sGz$WVv2Gc&C^Sk1g@6fa9)p181qGl;{O5HOO&@h} d+ufus$%DsfE!vW)PO32kk$7DZdFtrD)$Dq6H+OD(kwMHh{IX~!}eLHrG-mWrWMN{h5e zil`-u))F+vu0w3Gv~n4>)GjokSI@ck&b=Sr^Pcnk&ij7)JtzRS2L?e<0IUUu&`7dO z;vNMFfeHcGYbXFKKg1Li04e=Df)xUgoI{ii1_>Ol^uH4jN&zPP?+-^nFw`+994iqH zTu2a<0fXTJL;!N@Kmp=>l4&5jil^n(GtgUSIdZ=hx@L!?xh-cr=1M4^tNBQ|jdfvP zwelAO@QrVSn|jA(vk`mxe0H@=adh~RSGY3UF`w7uPRw=tbK$mcjt{W4`ozCF>Rxm7 zKTYcA5o*)R-EW_hw3^*2xjDRdpGv-XfSdGnZWnxC(*yJ9ve0LvDp9Pny7kBXHXgCI z0!#bID##cgNTF7Z33Xgqp=r3&W;lmmse`=x{wkex3G0Z~vt}sc6U{FPn&Ng@8?$Y0 zf{iH+-ub#@j+bQBnjx*87Iza_JLy!5f2PPVXXiR_I9};I9|R|B3TKutHmtGR3Nnia zVSN9>Ql8p0HJA}e6`9VH#~!%WOeaS2f*<)>3#1!pIVu~pnrbo23(gw{6}eZ8N;RTw zIsjN5)giYMFB`I01I1Ku!#`j3&2^t_1~0=b@xQKuMM)guk)U}}I>>w`> zOv`(kPOl6X2I8e;3;o_~32gH60sh8bg5IhyPO56_8&rEjHvdM&aVL!+1jFkgqK zumgwKZNK|q;U>A($O-(jogdel+J*E$bLB#8c^QJ4Jg`@}%WLk=a|Ws6i!u0w-ide* z4VNq>pdh)JjkY115amSPJC6*!u`TLkF2pHED|@&9DHfXisF%cUnozIzS6?cw*uF0e zo%ym9n~&=CeEYUTeJwhE=4W@1J442rva8wD6Vj^`|Br{wecYvxmBdpq@uISUKa<_X zHu>m|P~%%P&)|#a?PiP!>SAI-cPYtvVYQ=8zg~6N*4a=D%^RwuU>_6P##Ni9^&h6S zYX{#yy8joQ$~ZDM7jtGZN-JSNF}Pb};o@8&vG{9x`_N`zRbti`;mnkwXFyQBB`sZ5 zC3GQUg~PZ=SZvFv{UebcZI21>B4lI=FWILBPQ-1SEG>LcUS|qjQ7+1=gbqtuT`%bB zUA=Vt$Bn4X_7t~v2zRrbxuEH}xEB$vr_`o9d@%df&=M2@4Z0w2_(v+W!nIlSn1xif ze_tOQevfz895KJ%!@C{A8Re~{HyeN+!V-7qp-@&{eG&#cH}f=y87$lDt`*<0&yW%wZ}ZUuc=X za%|YSl?j)&?j|7XwCTXKYMoRF0RQ-gRtPI7rs|}Qwusr3?XX-gxg!&Au_iT{2Ky9BehgIkEQc zgV{5HYv6MFE|WXZg>lOxVM+YPIo6drvyYMI&gZ-pw0qpGtgS@A*OI-b=$Ai%(5F!+ z|J!PW6j~aJoV8V%^5Zu-C%G^sGz$WVv2Gc&C^Sk1g@6fa9)p181qGl;{O5HOO&@h} d+ufus$%DsfE!vW)P z&}6C3*mvQC%(3q=b11SU`;x2Yx%ZxX|9GGGc|PCgegFD?P-N&f00N`P&<3awG7*=! zDGCw*(aF#<2pP&c#7qE;yYZA{!TzB1?Z7~e-HsdQ80+0--t&$ zX~S~>00jBs$zY-*2wlQXIN57~?v$2QbaoxrQ}!k8v9-j%>GKx+PFscqAgQM(@>Xfj zl+g?`#e7<|u`|%<)AM^4x%PC#PbmgbLcvP-?}1n7!}~4-7+R{Q@`k{#;^E0Qp08YU zRjs!-uikweYLo=%&DV)jIaflQ{cb3ocgRVSG{rxR)$6bHH`g6EDQP*;&KV!180%_; z0h|ZZ5@)%gtKs$4|M-I4Fo$sQPn7*-{lCJVQSlq z^;(&0=(c<>%!Jh2q_X4#YE3Wi-ti@hB8fjbFtWkgU77X8W>(xa2G}%;~#hxnvtsR)IGAwpMgdJ5-hXtuB3hQ(BH~7VPAQfZ{WZ! zc+3p_)FL=HD3JLep*h05lVOsWo0lj?3utUX&iZyxDyZDoQ4-@*`RYuW76+W6$Nq9` z>NJbq^+()YnpdgQ)MRB=57EOy+k{<=d!62zW|SaOI50jclH79LqLoi`Gg#j+^wG}t z8W3VwVK7l+7g;wF5u$F{?e4o@^BzB>-8qVR9L1moy!!`OgsnS?wU1oPxiz&>a`m(N z{6J~7)L_NM;-|)sFWuA85c-pJPM#O1xoj)re`iREpKwLc4VcDCqfmB#Fp z5HlCzL2NuutWixOB)NvLtFAPt$2V0kE7`N#^DI36T|gh&;?p&9D7qc9{I5k(Ic*9EqPRmv<8geupiCC}t3r?c6mbG@IV8n_+MaNnH8p zn)vlScAJoUY<%km(>YYl98-}eg?eEX$u^=i32!|4IGBY(k%8_15t2>@<{@NY_7HOq zXA&y>A3cwNfWxrh5We_7Yr#LPy?*Xn%U*kJ#t&-`&*Pi3f~vy`SQ;AM{JUpG844yx zjec(M+r`IS5J7r_5D>;2%79l?` zFD*HhLjC;|^WlolSsB&aYCF=6%ug7MX467@vYW8%sMs8*^IR;<`(ux|@$SGZ-@M^y zWhDe~7B6@@;6+$ZF73V4MwYu!)p1+I2yc1d82qiPx^^^n$0edqAw~TW;+Vg|!cnWM zKA9QEF^c;XK=!yoLCk_@_g5{rOK_(RO8Voncm-NYZ(ApDEI{6N>qX@DG2|A~ZbzYP zIy@CUH*}xW6{I+G@Ksn=mY%r@4OrT_Ew?Mc&OC|HiRiDSnVfI%(?AqL9l}e3-j~x^ ztFK+DsZNsW4Y}qjtG<&!C#y)P?*mYi6y5;Js}lCUPCe0#NI^9as82&QQ!=r<&|9#f)j+ zn(h0GEdAHQ34Q+}o{EIKaeC(4a3yRrY`GOdwfq({;w^9fv|HHsZ1g=}QQEs&hYcFB zHzLb&+5bbt=mkxaH9`A2E~pDYiE!zW%iIr62A77YubnB>(^b literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.crt b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.crt new file mode 100644 index 0000000000000000000000000000000000000000..e06d3d9df92ff7341d96b8a17b6a097e7803211f GIT binary patch literal 768 zcmXqLV)|py#FV;#nTe5!iId@HQ&{?)VkdC}UN%mxHjlRNyo`+8tPBQ?(+s%{IN6v( zS=fY`LL&`@4Fo|P4jwMw{JfIXvdom!e3&3RilBf2A4nw^54(G6UTQ>Xv7w*=KS+d| zha)&OxwI&=q|#8xKma7f%)?onUX++yke`=osA8Z5cLOJ*m?&JvAsuK?MQO2Ka(=FX zoH(zMfq}V!g`tIsrJ-pQkZTI$nnSsR*Wr!xk;9mgm4Ugj7Z}c+OpT2U$7*J`zf}@{ zUG_rhnWN5GvFs-;c`Fi5`@X5;{F>fY5D~AUpjzIf?7qphl_BTOhyR!POM>hFO)Y!D zdQbk_VoTAyD^oKp7-p7S?y!mc5L;2RK*smT28n5_xNdFW{{1_B^Qlv-mh4!5@KV2C~3tk>z6%V-dL@+b?JN;hc$D zriicT{mxF+2Q#)B$b+PnStJa^8n7$i0Vxn>VKrc8Wc-ipVPK+S2Ktow{Ts$qPA$*- z>Gq*r22*!h1xWa5rG~L`W;5Ns>e%h1@&3~nMaEB>Y}c>bOewa_mVA>trA~T>$wTpX zozJ%WZ}p$3IVI*-@zbAG>6#Y0Gc2tvb{iZPm&*G0_EbcqL{g1v!D5jGDXwqt-mkjR ZRvP(Yi_YPFkNFhl8-HB2-yo#&G5}CV|EK@} literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.p12 b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..9e93a0a96b89c434e236a78e5aab8578fe06f519 GIT binary patch literal 1789 zcmY+DX*Ao38iytL3sL1t?Nz(h(!^T(t|gXAEv5FcOr=3=L79puYRj}nEydKn6H8lb zQFJmvP)h8owo<9}R?{nto^$V=dq2GAJ?HtI_x<#H5Cnh$2C*UtKo7vFkYtf`bPmJ; zDk1=lYy_b03|Aottd)O9KoNm8_Y7r$K`du0NOvG3FS zz+eaqp1|tmWP-DXDr5dg+iBOI&|lTvUO1+W5c{!%b#LR^XraeusTH17(No#YJB2yl zs?;ZR%oqKQ*+QDL-8^RhaGa7}`!e-<>cPlGsfd8ICfZ4LTUH8__Es1huw5ygoS%Z4 zA@()1_kG+TLnp*mn;bIvtqet#4DgzYTnjl0b#A822+^Z=$V2_6^`oTuH@hVHpvddX){QosRCMv9jSBDMS(N1X!P5f#m?H zRD3bN-$V4;!qWKkkf#a_hhEzCPV-)d2In`>I8mSooq>46c{Lj;v1AhUQzeAO*wg$< zR^)fsD?P4FqgrvXP!D&v$$=M!}arakG^#NuFkzQJChX8b%q7Afk7wv4WQazDS@m~Ifq&xM?s zhV5wkU)&oS&3CatJUZSAUVEQ>ZeqL3(Q1UHA&~;`bf30kYzf@9E!zDukv8yFLF(|k z=RrK``)ed3Re1AoI3Y5b1m8?y*AWB(%=jN6iwNK?HUfD441YYE zMF9FAJ-I;Ov#{a}mi(W!tUs)6Nwery(xDvwu=ea6pHQN(;H!#dJf#GUeV8G?u?g2M z{_feW+dEzrwt!)|XR&HgV%$vyUsH$17oZdG{v)c}J(z)Ckcv(Ntroj;-wZH0Z*ApK zdc7;BR+Igy&|$7nc4+QW%ss%zxxB!vo1=N2tNZvo#acgGkxvfxHr{W-*%JRrdOvQU zC@qfNsS$_>+U($%K@0}>uDL%DeqeE_#^Dzy_B`s=@siz88Kq2+?JMSJYd%I%2AuF1 z%?CZIPPLg`3Wt*|_TpkD-B)T^h+Rw=waY_Xm044Z}@pzRs5Siov^+xdjD`9skB!S zBapl2+$mE}RksmsVPI=gGX@JTC!W)~8W!8XG)}rfgun;LdN~DXbDbd<#pg`LEh%Fe z{H5PLdWeT;$u4@-qFga@<*>3h%4yctKiyt3fEnDg-4JUUJEidr|wWNz6C zecr`y12gNll+Oge z^}!`NBxO1KiT<>i7SNGVtyF{J7Rfi12k7#HGZ3W5pDhxSMA`M~x^yj>Kowbp^nY8; zc|k>h4QA`fpTXk|w~z%sHUyS39KZTG^CDCbk_b+KU6F?sEW*yh2HSBpW}?Ojz0%&I ZMklrjWE`~(de&~FK}c+CpYD%#{{=i+K8gSU literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.pem new file mode 100644 index 0000000..eeee432 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_cert.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC/DCCAmWgAwIBAgIJAPmCVmfcc0IXMA0GCSqGSIb3DQEBCwUAMIGWMQswCQYD +VQQGEwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzETMBEGA1UEBwwKTW9udGV2aWRl +bzEQMA4GA1UECgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMM +CXNncmFtcG9uZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29t +MB4XDTIwMDcwODE4NDkxNVoXDTI1MDcwNzE4NDkxNVowgZYxCzAJBgNVBAYTAlVZ +MRMwEQYDVQQIDApNb250ZXZpZGVvMRMwEQYDVQQHDApNb250ZXZpZGVvMRAwDgYD +VQQKDAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJc2dyYW1w +b25lMSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20wgZ8wDQYJ +KoZIhvcNAQEBBQADgY0AMIGJAoGBAMZ8m4ftIhfrdugi5kEszRZr5IRuqGDLTex+ +CfVnhnBYXyQgJXeCI0eyRYUAbNzw/9MPdFN//pV26AXeH/ajORVu1JVoOACZdNOI +PFnwXXh8oBxNxLAYlqoK2rAL+/tns8rKqqS4p8HSat9tj07TUXnsYJmmbXJM/eB9 +4Ex66D1ZAgMBAAGjUDBOMB0GA1UdDgQWBBTfXY8eOfDONCZpFE0V34mJJeCYtTAf +BgNVHSMEGDAWgBTfXY8eOfDONCZpFE0V34mJJeCYtTAMBgNVHRMEBTADAQH/MA0G +CSqGSIb3DQEBCwUAA4GBAAPv7AFlCSpJ32c/VYowlbk6UBhOKmVWBQlrAtvVQYtC +KO/y9CEB8ikG19c8lHM9axnsbZR+G7g04Rfuiea3T7VPkSmUXPpz5fl6Zyk4LZg5 +Oji7MMMXGmr+7cpYWRhifCVwoxSgZEXt3d962IZ1Wei0LMO+4w4gnzPxqr8wVHnT +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_key.pem new file mode 100644 index 0000000..7c9b7d5 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256_key.pem @@ -0,0 +1,17 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIzBcnfbXhBAICAggA +MBQGCCqGSIb3DQMHBAi28D1y2rL7NwSCAoB3MH/+CGNyX0rdcXdqLix5fVldShH/ ++q+2XM9iDQKbUO9UTMaPtYPlgYi0iYpN8RpwCldryPmyynOtdlntcgDJhYT0BMVq +Huk/DI8FpRGcf2jeEC3NNjqIpsyGblTuXPB6T6gGpZ1a+JVm7XanAkTruZ/TMbDY +pIv7yrj088/Id6C0glX8fSfVM56YPNBxGnkuN1y49aTIKHiM0ORULpQvpP0p//f7 +VhTEqvJibhXBYensdP4FvZslE9LAXdrbD1bI/1i3U5qjE3xR8GsTHmYP+7zd3SWf +KgfU+R/DPY20/6Veh1GHdWRDtPi4W9QGq25LdJ60uA1HVUfljdvtQ2IANi2WKlbW +ElBcE7hi7p/84L6SB3xYzMV17tk4ypVzuhKt0qAr2iPRBuRZ+v8yIj/WuTpf1uYE +ima8bzjAA2kmMfXHsfErVQgHXuZddYFk7fC3OWffXqtzAaxLo38HuiZ1C1eZw0/F +GMO2T5tpBGpw/WcVKWqE/DWDd2Ii2SindxF5YV2BQ3xZPhw/mKVXDP4kjq0gENFa +neo3y1WDfvI8K9eaCjhljbPdkDHw/vfhHZ0ZlfUtIBhz/2KVZMNiVLzc4PHb36dp +T1vZp2IeMVU7ZQMYZUaZfeTJBjOTbxopBC3D19Eyq5FQ15N5OUEaaM+TbkZfYTQE +2WJ4YL3e1yyKa2AVzzvCEhEx4xdfLeCDpXCiufUXUz4dunUA237bz7Pv/vre9YVb +WDcdMQEEgQ67G0a3TRlQ7E3DO6qd6AYPC/EwgMBEuLxbPETIn0hdZW5O54pWO7bv +9XKOR6Ji1K8pkiy0hySexyURWWah9jSlhwKYJtCVZKi7Z0abkiUu+IiU +-----END ENCRYPTED PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256d_key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256d_key.pem new file mode 100644 index 0000000..f49c6c6 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256d_key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDGfJuH7SIX63boIuZBLM0Wa+SEbqhgy03sfgn1Z4ZwWF8kICV3 +giNHskWFAGzc8P/TD3RTf/6VdugF3h/2ozkVbtSVaDgAmXTTiDxZ8F14fKAcTcSw +GJaqCtqwC/v7Z7PKyqqkuKfB0mrfbY9O01F57GCZpm1yTP3gfeBMeug9WQIDAQAB +AoGANca07NLWldx5ztMFx0q4FgcNVsQUYoUyi4xqbk6qIe4PeN4syIA9xsMKCsre +s82nwitBvQ3EkAIzQsO3rT7zy9xccIQ5fgB0r/SXAoZP2riArTFsI7qxuJ6baPrN +28o/zdNCHac9cbjoCnfJPbHaDwRimvJfiy/mnUl86IryxvECQQDw72zi0rPaXrQd +ojOsOfw4gvBKMag2gXOyNSRQrzznwe4tRhRcZEO4ZYMab2j19zR14wGaYHTluvD/ +0o1NIsyrAkEA0uW46zaN8Z/zG2CqI88Ka0fwaPCr24uP9jPTRNxsB3oFZseSPnX/ +idGjm62wTTy7P64axbbddjrYMSWmnPhWCwJBAPA1FG7zuMI+5v4gZ7oOuYqx6NVf +uqBU4b9LQiB7BZLeAxL6KnSOtgGSm2nwp0mKo6/gmgmKnyEnBv1Wsu+zgS8CQQCP +BGAJij5p+/kluMDIdc/v/qIG2CcDRDqFUJHV4dCUpWfiUjZXizeWo4bavMeRKT0m +KxBWwfKfCbqwYYMCcdoPAkEA66fbHKCvHigSdqf+t8aixmEjejmUKP+C5Kt/fN65 +h6AwgKdwc9c1MsUAd1Fcqzo+FOOAu0bQzYjEmbgsL42ACA== +-----END RSA PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256e_cert.p12 b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_1024/sha256e_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..4ae3cd86498f5743438476d35ce908b3f550ee21 GIT binary patch literal 1789 zcmY+DXH?UN8i&bbB^CpbA-xf3WP}UWkdY-Md;i*5d`Xk*p8S8h}qOfEEJ6Fy?;l`PdrsGhJ9BwtYHOizU+GQBn$P}?GXx1XuxTW6W+%f)u0Kp*z#!wz?$&#of4+RCTvDe2Bp z_e;AHc5>?DcB@7O^n5`0NMiY-h@-vv#(Y5K0jb`|{vJkpOvpFeCdlxA8XMRTpv>vW zfs28vg<+RKj$U1d_;uDBX16o9vvU8v8laP%i=OILwB~8@GFQ>TXp?}M*@KwT13uIH zn@*G3uL(vt&6JIbc>P9Mvq|y@#Q*i>rIk+E+EQ7$4!K{<@0k!yOM|(neHSfB;v$~8 z`$sr~)tt)ve5NGG(|AsQDeZ(F7IS|0UItT7KTeCMYbo9HTU3oj?D+j#v4ps- zk$P$B#NcuoI@#q{`a|Q4a@ZlFc*-Lc)p@_!N@HmNeTH(lF(fP^bw9ACN+8Hla5eh7 zvU337Gr3{$fjFJJ#LJYTCMF5Tkej+lL5DvO9OHTosU>K;B2aL0kWsB3LCO!7_P+1f z^d6vaNUk}en^9U$^&VqS1{q`j&^D9=bl-i7s2nxw61S|a@}Q$*DeLvj1bu3ewu*2I zTV}(+8mw*-plY?;CVozVx}DOc_%xvP?z#5~`+(V2QuSJIP_@8N5oPE9!mY-wSDRl* zGcn(Jfqb>is}Mm)oi|Zy=1&e6#B;;^i(wZXCfEv;{qy`WfCk?CA0Z2A;6I==@bWQU zI36xs@;`b?fWXIL*)e?bf7U|2SZk~~V*9Nl3-`s^Qwf$2Vr?#1+XPLUXG-W}w4@z*`Qnp`{dF@}hgsMV3MeX*ox{EWhK_k88(uQUWN zL(38ye6yeoZgy%-(k!7RBGLU+?L9wCxTI!AXH1~3VfF4*{mw^U%Ys_qrCQzSSK`+X z4^LX{5HZP!5CB`2raBp!*e*1h3T+=(s(C@*<$2ZKo7#mX!eY{S)NY1{R&=nY;VfhMi|=fQk(CKl3DKoqqlfLm&si?3mn^B{!b+l zmEK2=Ct-I~%7aBkQ4hvQJ%X3OX+T=s zoE&2cvzKf3K3W%ErT$&6r{{<($V#K1q zU@#!$j}N#@;;G)&qE$WMq~stma`pBzThl%CXM=nX>y}QAY01DNdzzmWqn)rwyU-b? zY}J?6%IG_Y(&+_2&9AK@o4UkCug$IBjs3Lub0Q-qp~olrx9#9N&q~Y_-=xEQ>++RO zX(k<^cPXrB;X?y^(buXnAsir&rDoj@ z)YtsAelh%e>l;IX2f4i&%Z{N*wm-1(VUA6(;UeVNX~nu%l5fNBH+U`-;jw_qe_Jh% z#-D=9IC@DlPIznEVBrgOH;VU2!mDH{01qeu;&2%51O%)A6M@R?D(ksnE8Mnr+5WJK ZWY5fX=Gk{pG1b=5g1f)FE`DkEzW{?dKluOv literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256_cert.crt b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha256_2048/sha256_cert.crt new file mode 100644 index 0000000000000000000000000000000000000000..bd788b5de7701ce8e1ec5cba0657b3f339fdfdae GIT binary patch literal 1029 zcmXqLVqr9BVtToNnTe5!iIbs0YtO=)zZeq@c-c6$+C196^D;7WvoaVoPBY{-;ACSC zWnmL$3XL=rHV_1HIC!{x^Ycnl%Q90^^I?MQD1rh8d?1xvJnZhNd8rYl#fE|g{2&o- z9**GD`$@#ek za^k#31_tH^7KRq4=7#1`K&~l}YYycOUWYd^Dj^3lBP#=Q6C*!^K@%evQxhX2!`5?b zQ+{St-J9=hn#FK>o!Rq5{WRl>FKp(=U6|&u?NNE}KY7n{XReO|p_Pvw+9v?WcUNqRWZJUJpjsh8z*2TqK z2j?2y;xReAWI>3Gw^)By!rxb~%YGh=aQ+l?%S(Pw;F(1-XZN2nl~?m4cpOw5c7jEe&d{0wA)Nkf*8MT|v6*MYUuH97mwYXe&a*#jzy7u*;9F^~sI zE3-%#h&5nWzynes%))BG%*gm3In03x8yMz{42xyop3J$l{$h{JbxZHeqr8zPPUq#k zpJ#0owJzh>^`8gw{DUIAJ=+injZW{};R_xz%ZQ--8^Z))?XqEoR@!~|j3Gv@dRXEF^RU3%Za0}1%kNS0ynw}bu1yKN4 z&^`hS+Cg9e#s5@5JQk4gCrYECruy^Z|7oZZP$0v<7r@jjH5G@hrj#FPa}Lvw*D z6brDNNWw%xrSSP);WF=Tsq|+w6j635H^}g8#i3eWSJHNh6)N~#b zjT8#zP%g83oD=tCX3FbqmPA_eR3fs?Hhz(6Hr3iy52tF7A?9Jt0va0pW@PO(=-(5u zHw{%sUvS;_dx5Aquj#tN3RGg^jhRthmmYKZO8XY)&aH)7!^;oBUGA(Hi&d)u)A)?= zeF^mpH!3fYVsk{q?!$#dJDPu+ySm_RWLC<&iq)65pbPH){v;T2Uc@W*zRR=Ui_MSY zJ+Wp4UxN1#x22ECZ?Q;fF)E^1T>~5N@YS0QcwMvQpeoL+wA>CM2MxyE%z%lUL3YYb zuRxnRhxA`Nk{>AEfppw58+F^6rHq^0w)z65I3e`|kC~_>1q+$f7>HaUOK3l*8k)|^ zWR{{QBGi+YcW(lm8BD~s7XTyXv5ovy84eR00&;b!dHI{GG#S;ToR2Y3(PGBJM+%~X zX4nEwqQ_@XnB>-c5TG;l*PbB#CI??ukqVz9d-vYVT(SWnD_p7j7iV`p1=8?_=}3R^ zxW|U&tsAPerAQ|zv>XZZ;|(|eI5rc*i8#}|ukL(wcVB83Ar_q7zN#0-sP=l?!|n>ENr}P73BAT77DK``|>{w%(^y$~lyD`fT+D3r#~ru03`2-%UzCbVa2@4AnU z2a0a*Imn(S8rmr17>rwdB1*Q@;&o|3Px8tubh{40%(arsR?9|&{VED%^4~9;%l2mp87M331mAn*6T%vc!wGzPuR!lhl%r6Q`pJo52L6NrR0)wP{ByoS zy4HQhj0%on%{-j8y(KlfA_g@juC0LM!ci0{goBDP4u_}H@t*J9`Urn%ZFDfY8I&hqxQ?!VnL(aUp%|N7|1J@9u{*mdW?oXdG+UTMWQpGGBxlKxPEqmW zCuKpa(?Q!CMvD&!-u=wcaWcyRt<~*oC^2D>jM*mb_VYDW&js@bG`P?Z3^-MCd~V3R zLP2j1^|=Zb)R-cHPv2@Fj$B!g=!aC9r|UrARVFHSy?ED2gc+K_jz2k8 z4Cb#sU2(Pp7DmEUYuxfTEpX1f(Tbu;$jr3Sb#G$dE_@%q{>Yv%ALU<1MR1dXcD&uyP|Dxmfv+Q6sK;CL-U?Tu%|-K z%7Nja{)cD6;jU?Bx$2kO57jdj_J29{cG`VQhG+e9_kVP;4$_>Op*Xf?yZvl<3#`Ja zVaSa*5jJG}9bV#QL%Xm5XE&)R-YdFjo_iClUG}sMkM5Nq-jkKs$Za{BaL8^Kwdd1I zH}ykCxCc^1=8I+FH3NE@EG0f5t9UK_wnNV1LmqL4PD=D&$8~i3s2aJRCCRMARncQP z^_#hj3LRgSz2Em)c(!zgMfld_W5`BjN2hjt&S|@irrigm>Vo+XI~Q#VQgT^d`KKC8 zh{ot(bG4RI>KX6IC5mh1(d+dFgLXU@B!D@Tw>`nkO79kAfgb@#(Z*`rhqg_wzP zmMaX^LWJU>iEtmj~``uK!kgQBnrx($_IzL>VFI6tazU8ub_k?8WO~SOfPx8iga^SBm<@*z84Db7nSa}SspX) zWYuORYEjwQiYYYFFV|ORf zC(;z!Jhrz%(?_hoZW>Zwtxg-N)sE|z5)$PSk_z)1pd6eK6&Y3Yg%RY93{ zcnMJc8Hd;7jMK7IE+f9!x1K-d<>j@lFe>>>_dcP>xOB9Xwq?%BfWte(axP<=~$F|6hvRH?2Wyy8i8eHdN+Q)UC=qI+i0scwOU&LE=%20L{_rk zQ+aS8RU-%^bnt_B$~o4|cNNujXp3()8L70Hwc&cPoAGn*+AnXv?CH68 zG~GJkcaii~8h`Nl`3|#7-EFUpqqp)$%>k(pnqfYH*O`}`e87g{le&E>T)mpj`OxBC z^N}qel~dtM89AcmBq)MDDLF}^$0V<;(NgM)w$Cx_(@u>YG5g7Lzx3E))*rBfiBaBM z3w>#5qJ&VWO}%Hxo?iQA2v|jCWz0LVQGpuv|adXTMZb z{jXZ2FhcOZI)d1d900Z*e}eNy4h}BLEEAp`m}K)kO+PR2uLS>iI(On9TkAB lO;dbq8Y1H8pEyk_{-;PSfMD2sy%Afo-MIskD{$jTcft1R+@%TMeQ%G zS+z&1Rurw<@0@$@ckdtXdCz&CbDlqcFeL3QasUMkNlOKy5le(8lIQ_cfHEY_DG*6> z1Vhs7!;rw&|5TtdB(U&Llt&IA`}5NOX#g;85beJgt^hzV1|YS=OSL$phn@*JIW<`f z66nA`DDjj8D)zv866#n=#U%{Y|QoT+S; z14eDiw8fkB3HIK?7RSCAdHq9mz2CW%;}pJlJa?{kuFXMN{K&Pj z#RHoy$8Q+12An^{nJDJ2q@=A9JVnHj46C;-y;m87MKdLt-Uo>}ck?XkqzRuU+b~gH zdjyldh~2-!TLrF(_%x2z5KE4)R~gu5zJS1TOnIwdBil|GzMJ#g9{$!qSdYPxkw@ zDK0rtEJ;69CHXa^N8-_(n9ST2{YC_Wv>z(X-$cclr}&8{yrz2-esJsgxL|Y-hsg)) zJp%?3ZnNII>dHEDA!yNms=uk=hNpr=wPy6Y_~sa~ngVITTaF?L=o2WSOR6^fRGnpv zbhwBxZMq(6TGm8Wc!v;*wRYPzN+gAUn<2sr;9CKcH4|xoqCtLS zmvP7B{uJMdPOpekR$jOO1Yw z-@C0S{z+bC#d}#3+gM3Vjgq~4&MNK8s7a`rl>yI=%uxmA3XU9RQ$4<0ZmQoa8)Vtl zQ^Xs>`!YFE%lvTWeS~e8CYQl%x}p$XwV-0uzes6N@1rsuPy6?lg3zLAtBi-dAQ49q zr}ZOKl_T=JYYNG9kiM>r?mKjueIDko_@Xy74i0a>>%{_^i#kPxkMw`2cxX6duzkJbdo(gy>8%5iJtPaZ2$nWf z;C(mM(9m(!m7$$&@M@(aLn-HOVe5b;kP8VfU@B(t;_+)OoNb$Q@IoIb^dw#vzh&s< z+EA@x!G!n4MUb^3-Q|IvsL#bK`grk$9A5cw?n!TOxmrK2K>|U10$F??Mn!@QeZ7^@?pM|3`07@ni@7;L16z09I$YlfpDE`(gQF8eZ zH!iu*Y%S=knC*df7h&>N(D=aUz!ub}U=1z_?6J~tu1*tI(iL+}#Qqt-{rneZuPon7vchoc`J1;Hg<>kJSM}q;tN`IHtWs${66MqcAkd(Ln2c$A2r3?^BDfuTB`*Tnb-G6wZ z1(5%7jQ9tz?f+AY;%~JWs_)s2zP54sTP+|GIHX_}+Ajgg*5@lFI%9P}-vnN>HYOhdTY95jDm>ZX$jUH_ldnFjcJ)Nh> z_I$YSvdC}a`%;NNAHR`qP4|)GnC@tJ^?iV0ey+KMtIzOGlS)==j&jag0@q=!U5;u( zOIYR3&mtikjS;*avvLh0s$2zrS;O??cJi;-N`@z|@n?dH0ISqSM(y0J)cE+Eg%8Bu z_a`+{iG3^+8`9ZFjf-OrS8$V4Ndetn<5j-NYbtqB`J)A&pN&Et7uG%Y<*j~*)(_>z z^JLsiuUn^N?9Q%=r)izdcvwBI%{V@s5T)(*m|2ufxE(a;d&ctQ8vG49;^|!Aay2|3 zH`wqjn)u2lx})HoKs0jba*+n90^+BCkaZn3yj0}>k~|bIb%8-&R4XTP7_OSB0hbiy z6yD;c-q@!yS894mc}Nu+q9z)Ww&23`52!-eT7Jvq4co2oOF+smcF|*3WadwQUR(EJ z*}H?+F>H$d75mEEcf%xaW)i{%#>enKH9sdS%e!y}o*k>s`I|G2zl^H(!F)Mb#JeHP zu)LIAYGPzNnv6i&lIw7PZd+S56t(hjFuxiVjaZ)1fw7wjwXNKUV54|kY{C{X*bbOP z3}{ag4^Oh_j3{E7Xpp)V8zGjKQmGNu*iN2MCKlgrzg z)vE85bfZW@ga)f8ua?&zprG8p8slkiQkJNl>O8wERZ(hh)!^a%HshVfX>ev4P^Tb~ zsCE=RfrD=!hE)_+utQ7cBl%8)D{8r2ntu}f9cWszD4?M?g!L4^<;hk==2Z*k5A6i| z6u0yD>xtw7y=poSbUSe7h>d_4s6DR-TRYG9&=?(w2FA#d_h~_in^d*e$Q8`>!pnq% zo3Lzi?IxO>MOEz2nN63o`c{KNOC-k!u2zrBSxvd+J{=qmyMK0nt#>an+1O!;^V138 z-qwg`wrxO$WBEIoSUFs$n|ij_ra~pwCeZQ%y+$IqK*w5hB&=(fwTylG0==5W&YNj+0{$`yY7`B; zfEkWzQ-MhPFuQ4cM~w)B=f~=sgO6AVYo~r0T2Cx7XOSI7(1?w+RoUEN$nEEb_Q&<@ z^D^oc5Wey@moBiYz+0$TkB!1%m5pCZ?pd2IIzi}H%>o%Y^2}p_8G7QX5$xb$G{+KWrEbGiw)Kv>5_i7g zI3}zv8 zsoKkM+p>VY_34VuplwYqp~Gq(wy@37=r>*08j2;k1P4UpJjkvNTd>` zcEwd7v1t0VuGbZ9;g3a)W9;br?h^ZzrB)i%HD9pj|A?u|&)4+r@t-&KB8tMmT7-8p znP(L4(!wyI|LRD?BFzc}k7?;Rcp~vk38@7c-c6$+C196^D;8>vN9MnPBr8<;ACSC zWnmL$3XL=rHV_1HIC!{x^Ycnl%Q90^^9_Xz1VDo9Je*KLpqPLGA4rUghuu9jFEygH z*ig`bA0)!f!x5aCTw0V_QVG+@%)?onUX++yke`=osA8Z5cLFD)m?&JvAsuK?MQO2K za(=FXoH(zMfq}V!g`uT^rHOeIkZTI$nnSsR*4<5vO2|RX$jZRn#K_NJ(8S2a)Wpch zaFX@p*RWQ$ihX<^_p-HxHQWr9Emfb`r)zz$G03d{Nzpc^omcKG^1g4mZvrRN)7Yau zi=~oN_!5^qeD5Y^rnhdlhy3BA-%I;~($mBaJN1j#Gr#`Nd;6WVd-ByqF7ufmEnwNV z;^<{t70bg}Z?AZq{`+a_t)Bf?Hpd*UTOz-W%qZ^^G@tAz3XgsvP?4Q zwqgH@BWEAqk9@?VF)fSLe2)BOg9)np!d{*zbX#Eioh{StP@pXHeL2V7({o}3^V{DF z8m!sFw08~Dv_*eJ_MY7+RvK0Mtt%wSd*%CG$DONKm$Lr+ea`Z7nwG|`>%382Gq?+v zob_zop*Z((%3DDuW=00a#Q_F>2C~4!BFo1j#v<~^A>pAQ73 z19_0NGK++PSOaziJRk+aEUX61jEw)0!yK5bfnmYLnuKz6?DkCN8<-hJzhsEycH*fRKTq3hbV*iS@{SeE)WZu&RXi0~Pc!ruoe-fcH{=e*HtW8r}ftN(rakeg*C7`Ugu vwp~DT>00Jwmb_+lRhPu)FNMXA?hABmtSs9#x%6yz-_jhX?_cxMxlRB8%vpcJ literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.p12 b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..295a14e8dcb4d19c9b1e032eea223c408a291fea GIT binary patch literal 2629 zcmV-L3cB?$f(k(b0Ru3C3I_%WDuzgg_YDCD0ic2j_ymFp^e}=6@Gyb|rv?cshDe6@ z4FLxRpn?RLFoFb>0s#Opf&`5Q2`Yw2hW8Bt2LUh~1_~;MNQU3N1~*?1)c?e$qo-BRv7U+;)kajtWP&RT|K^<#*+?f) zAP}lMay{!zcVvyd)1HO<+B;opv50U z<%4FW7J=g}QwScl4qg)Yx=!R_qPIBb4rgA<^CucSL20C)8LaOs zj|`{2`f3{W+@sFzoWm|U2We`*@)YxE9eF|e@}d$r)+|FhEoJZiEs}LPJ{Mz4@Y?umFu>mqQ)0bUIAt303TOU?DgUdvm71xQo!8EI;0#qVdp!dQ^Zhq!g-<8YAlXw z?My-Jo_=5ieMh!|}Y{rY9g6iH_4*lg@S2R_w>YgZc zKTBZqdz9HG6J+gK{l!^XB1w$n`8-i+l>VOzfO!E@7p}+I_4SnK-{iS|wblfu;*l|_ z&4r;4Y%ahN()9SMnT*?^OKarDI_>cAPoX zM!ctKy%0r##GFKP9x^KyaY}MJg%8tB=JfOey|a}UH7!|PIf~r`75BnVWP6V7IX_%A z$>h_2{bm#fAeRdHF#4gZchMUB>K-tznT%5GoggZt7 z&)k(A5=URbuv29uW<~qJasmm-MvAd&@li{QfFM4-k~21a(|I{P%O@S3Dl7*mS~;w& zTA3-LAjR~8!buun%0_;CIJDeMbKbKKJm}7P?tu7KRhqN~H}x}Qfvu*m(SI(Ocjh2Y zTcS_yFJl&0FLP`9ppnO41Gq;t38OXwSt(^s)7K8AD-=E%U%cI(FoFd^1_>&LNQU$As|5%@3*5h1@ECXu8l&sMD;!r8Bkw%WwPV1SpA*oM>{HuBDm$>9&i( zcoanRPn5Y)d9{V|@-uA0i7_clOBzn#8%_!wI{fpH{q2-o9kdaa;l2mkC6MuJj5;qu z5|I0sU5H62RB7F^4-N|*RsgmcpK0dz)_I--9cPJyvRv$>koj8h5rs5s- zaf|1D%=)!6N1~cqz^DBO_7R%Ec?d?7D8|fg4^|LLO1_pmFTZPWCOz^iGZx-S7FuH* z{U{zzHdBG9U<1TnVaGKVB2`ix-f;r6clqT>#TvXp6D{s+Gs$61M$gaw5$VL{HQu~Y zTYG}8RZhG2@_D=x)i%C~3v^5BH@S#HaFEPYLvr}@`Oc_hr!C*yiJSI!j79{8zMyBv z?W$(sGnQAIBeyB*uFGO0K^l`qgc>%g2EwL;v*;52%zZA~az`~yAtRNC9jNG*lbYw; zm_kLpw7Jq2=pyeHq4z5b3u??BtWCqLdSSXArj*ykL_A*=sJ>^h)R1D_YovJV;T5j& z1+VSnQ_M!widAg!`(%EAR%N*E0XZqb6E6q%k1B?x*9}jn{M|lKi43NlbYk8amTJk} zfJ2F@p{#4Xxa*i2@*+Y?VZWDgZVS&2}ad)}o6 zT0Dbfxfh*p1)}Qtfh`q2+qvR|s|XR7A;a(Z;h;f&c{y2Dc??HH&dT{stUnd`Ml{7r z*8n9+QpfwovmM4njcpL=UZFIpx6$*oo7(tRb?9h~dRg}gz<`MtkSlXt$3nxywJCY< zHe> z9%j9rB2@e@k2FxpiC!xiGRiPM=5=MiOLyOTUv&zY$diA>K9ER_Pb9-Hk#YP-aayN! z-a#yS09k#J`^*__gpbLBS%jvXFT>*{VuRTe1^ZQK0{WS|jyeW3i5913E58y7H;Rg* zITaFB!?u}YqPT}*N)L{$)mJ`remSu-$p}M2JyDl;MWly2VodUzrlWWhA4$P8&M|H2 z%TE`}MHhPok5TUMLl4elCVO8ODUj7y2L~n#SUHMr$R;JuS9|*j_E_LwbQ0hRMxoZY;{tc?n(;=S~jw;993HQC0id zA+@YvL$)}=oRSxHNo6b*MA5T=${8E87)Q+-as*3n_$W;53VV?awbuPxgnIBtm16`= ziAuOKu|vf@r^~P6@qzzRUv-U5aJCE;JDicq3#Z16lMWRtgFpa}E7Fk!@Z_}Vm}l+H z%7KdJ=+00?-+uKHXwlFa;AutIB1uG5%0vZJX n1QZ9A)ZDlXow6zDbp6%2Kt4kg%8djFH2X<*@V|hD0s;sCfG*zR literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.pem b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.pem new file mode 100644 index 0000000..7669d58 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID/zCCAuegAwIBAgIJAOHjT2U4H5QqMA0GCSqGSIb3DQEBDQUAMIGVMQswCQYD +VQQGEwJVWTETMBEGA1UECAwKTW9udGV2aWRlbzESMBAGA1UEBwwJTW9udGV2aWVv +MRAwDgYDVQQKDAdHZW5lWHVzMREwDwYDVQQLDAhTZWN1cml0eTESMBAGA1UEAwwJ +c2dyYW1wb25lMSQwIgYJKoZIhvcNAQkBFhVzZ3JhbXBvbmVAZ2VuZXh1cy5jb20w +HhcNMjAwNzA4MTkwOTQ3WhcNMjUwNzA3MTkwOTQ3WjCBlTELMAkGA1UEBhMCVVkx +EzARBgNVBAgMCk1vbnRldmlkZW8xEjAQBgNVBAcMCU1vbnRldmllbzEQMA4GA1UE +CgwHR2VuZVh1czERMA8GA1UECwwIU2VjdXJpdHkxEjAQBgNVBAMMCXNncmFtcG9u +ZTEkMCIGCSqGSIb3DQEJARYVc2dyYW1wb25lQGdlbmV4dXMuY29tMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyQXJ9VaFBni+DvG9BoZWgNlVHXUnkY4t +O96BUjaP5HK2QrnU3KJL3zm+kAkC5V3FjKMaY2QOYaTh70YWNi6uu0gfw8X3dY5S +Z2YWw0KPF38D6/8N2+4bR2PVokSfA+KgBL6oxdM9JDnDau3USMv98pXajL/Us1zD +ea1OToDVjyxTr+4kpt+5nkthiDXdQzrJdhlS2zGPqMTN499Z4gwolmoFN5wf0zCQ +Jb5W6chxRqA99wZpRsJRHQPfHkG7l2xcEW+H7REwrLwCvawClqL8FL3NsRZ1WnX2 +ilRiS6nvusdDegWlBfn7zjnTZioo2tcNWoqYC3GkzUmFuCGd42TtEQIDAQABo1Aw +TjAdBgNVHQ4EFgQU/EBg4UxQv6dKsZ12O8g+sddxpOgwHwYDVR0jBBgwFoAU/EBg +4UxQv6dKsZ12O8g+sddxpOgwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOC +AQEAVjzNE6cAOzZLAoRQUPCqk05ypHX6Snt/+x1VHBoVSk+u8og4u5fZ2w2ZpByi +GL+orU99Lq0JmgQPH77XG4lN91D1kr5FYXfHd8685sMAhQ3btuolrDzS17PDvY3P +1CRVM8zXeeHONvO08iy175Rw67oA+7h2lhLcsSvmLgZLpwUzYAFrRtFocSjULaAt +SEn9AEgm7hCVz0kId9Z/KcTfF1VqVcWDHWveNFbgBNOEk2eg8XZl7V6X9iVYV5iS +V+9SId2HMO5DsUqxccCwq/7y8G1qOhFRvI99hxAppa0DYwRugyclRGHn6RMXxb5R +QYF5drqTdc2LjqVsQvf1bmcKyA== +-----END CERTIFICATE----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_key.pem new file mode 100644 index 0000000..7a73733 --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512_key.pem @@ -0,0 +1,30 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIE0HGSRxYsxYCAggA +MBQGCCqGSIb3DQMHBAi37LLW0B3PawSCBMiF3dEYbxDaktRTRITECQKHDnvJ4suT +hMjKFGEQRU42VOGJtUQjNuRA87xLYWC9n/OghXiJYNQy02VAbcdz1MzSp7HhStYq +muUqze67wNCGrCZYKeK0IvtFpyqMquvRtbV3wOloe3kOhiH+QmqB5Rb9IxwORdsv +OQGJLwy33AHxXjRVAMHICewk5J7EI906eVPONHGchGMzMVSwJJ1xpvSOLLj6AC+i +WnS8tr8WW16BVfcEfm/JfR7lqkxf4E7vV9dYSc8HIOEGFFMeTaoPT8IcxzZiHijx +oYrQyVvinMpwdi6MfJsyNiQfsaPs+GA/JYGkjYzX1n5bkneOZw004K+ASuL1r06Z +mSeW18Nx60Wt9O1QYfnZlAVFMYluiQuJ2Xt/my+R1CirewrMO6DeBCEIY2/TVyxB +yrpJawTYbG3fWhVL8jXsf9Cx+APK7iiuGUdW5BnnDNCF/Hg9AiiOGBk8bnqw+gb6 +sFEVnkFFXFGdU27Yhp/V8MLjTipzSbPBJTg72wBUrLeafyhzXunCDzhIh6mYQFa/ +kOulVoycB0Mwb8lIxArtTWtM/8i/mmCSalslPNiB1MlmN+tvJXMJd2DK2Ox35KmB +nK1z3QCd/+UubSb/OtpzDq1Th5KCNEyqRNpQouaqhHEWyhoUuzX1StPVHAW25aUi +fj5aYxymr/HYzBDGlryA1yjK6nI8zpy6BQDM74C0Wh6jpXtmxqp1VdJU159n1isT +aelEYWzIPFo9ksvlYZjv7mPdi/HOjAwq2Jo9X8ZFoohLNk2NBNVbP+LQgj9Z6ffy +RAg245ifKsHJMW2Vx6+MdbC1ZKNXCF/C63TJHGl0tsQZzQoSZO5aj4ICs1GGR7AW +5NeNI4tcI6t8Q8x4Uxza+0ISJbb205XICh0+8MWX3S+NqU5jdEKX6yIhZ+B5k1tg +bmjnHZh1Lj5UC1Oi6VyyT1toJJ9A2kplm+Ply4zBgVI8frXyJ9dRPqCb066WHhoS +Y2nhhpL3KEVtCWAGVQfneSO1Ogh7JbKPLwOtJk9rDkOTxNErbPl2k4TlAD5flw7s +CNQA/lekG54jRxyMEJ5wR3WCNrfwwmOoQ7MUIKrQaGAyWGokwAux/4W9G4ip9XXD +V9HGLSO3tHj7aSal7OQw1yhrfTuTojiJvBdTC7wvKEQllieRbD4envhl4eiwAgQt +7jcRpS9x+1FOz10JhNvwOScyWtdDlhLa4ISbZ5LZqsQMfIRyh3dO7q3AXaUFZZmZ +CSiZDa6Ika25FuR/mBrtJEviEkKgeUUzhNa6YvACZC4q7fPj52L5ymhtwX0vx+97 +jb9w++qe9zLzyTaLBZUclc1Ibz597HQYjOl6gSwSRnWeiMJAc0d8mWjWvKvxhR5w +2Wx5rIcVXxouIQ9FtlUJ9uB7i3XBuYrq2s4YUL7i6dkG+LvEU71a70EG8ros7x5+ +I8zOGoySK3XOC+nPCXNysESqY/Ra4se/SNmzLJk5SeLfhHNQxDvCVsJmEqqSAQcd +sjp2A5A4mViwaIzGdlUKI9WUhZZ16A2Gp7JsuW1WYeTfdl327wLMM/qKuBlvAyLD +Q+TwdN0DqgyrBMUceivvpVtH8F2ffY0rc8QlbNt8q2KpWoVXe41uq7mxcrTk2xt+ +MCI= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512d_key.pem b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512d_key.pem new file mode 100644 index 0000000..d59763c --- /dev/null +++ b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512d_key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAyQXJ9VaFBni+DvG9BoZWgNlVHXUnkY4tO96BUjaP5HK2QrnU +3KJL3zm+kAkC5V3FjKMaY2QOYaTh70YWNi6uu0gfw8X3dY5SZ2YWw0KPF38D6/8N +2+4bR2PVokSfA+KgBL6oxdM9JDnDau3USMv98pXajL/Us1zDea1OToDVjyxTr+4k +pt+5nkthiDXdQzrJdhlS2zGPqMTN499Z4gwolmoFN5wf0zCQJb5W6chxRqA99wZp +RsJRHQPfHkG7l2xcEW+H7REwrLwCvawClqL8FL3NsRZ1WnX2ilRiS6nvusdDegWl +Bfn7zjnTZioo2tcNWoqYC3GkzUmFuCGd42TtEQIDAQABAoIBAQCBOqJ5gNRls6tj +Cg7dqfDkRlMMa+szDHaR3Vm/k2nvj7sRrEtmR0OFTqbuC4z8DMtZvOTS7li8dvX0 +D1dqH5qetSAOiC6sOQFKjXumrRw2G6ZWyZGMSEbrHwgQmBKtubvrMPJosoLEzgmN +rTTiU5l+oM1t3EiNwd28VChaGUKxFcUw39cpPQR2sz24H9DPy3jwA/O2wHRULasm +vDBEmd8MAVZZ2VANzmPwynJl5/CZSJITcQ4sOZcAsj2j0i9eKAI9KF0Tp/oCq/Ly +KftQJzEdtHem6eh3oDxIUK9ewkzA8hzN2uSqV7A5YjljSIUyaE1fPUjAT818XnVw +PD09yh/tAoGBAP/iziliwKQtBI7QMzy5T5scLvfA+30xjR06VW37g4EIbH8m2B22 +orst4MKUr+q8wSAq8Yju5Ox2EKzWFvHQP093HqZQyt7+LeaauD/aCUvnkzX0fU3n +ZC1WBI302rtgc6RsXNPbYbnI8X7JSsmuKSqVHJcYMHffDiaywHm0VTyXAoGBAMkc +uV1vINd0NQwkv4uYnZBwEG54JLxqYmqhb99XlQ7v9Lka69IXBZv0Dajw5uEUdusG +D4gTz9XpkaO86XFSzoYtFcBkKnrECPf50n8HIQYPLSYPKl5y45UaWRqQ7MyJuoM3 +1KkOLg2ZnsRe7nNAQpR4CcNmX16rhtuo3rYCKVCXAoGAIdoBaBw2XAHQnowQmzHw +xBZgaEpReuh5QKqc7qXdac6Re+jJonSs5pJVL6i39RfvfK/xsCnagyXDYvoXovnn +xj1+AoahsAp0TBOf2GKh5DbIlNS5VvsLl6vPgnAoF63U3qWvSh+1t/xLZnh+ulud ++pIrbBm5H8KUfq4bJH6k4BUCgYEArCvlHXJH4WvhBjZnrXDIY6Es0AYXHR7Oho8S +oVfvikwvbFD51nBTIwI6t4kVf1fvvqD/pvWfFnjRcCYIjDXiDMiIOJ8IJvWw3+qG +JK3Lvc48TrrpANbGsx1NbwrnTuwSOsgPTXOQRaBgZakH5q760PQ7F4eK2hdqap8V +mygaip0CgYBUQVRerk8eQMPoUvjCJx2gMFt28DpGzQtiW8AzrvmkVViWxyulfMJd +B4XdmYEdeufM3Co3lcpfyMOVvip9lbv2FlLD4GcsAuajvV/xuqG59GCzII9NPqWy +hVOLUGyTV4PsBUzY14BdgJ4nhihPze7ExoKvx2RKSYmafnD28Ejw0g== +-----END RSA PRIVATE KEY----- diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512e_cert.p12 b/test/dotnetframework/SecurityAPITest/dummycerts/RSA_sha512_2048/sha512e_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..a528c95a642326340587823a9af2c32ae5fe9c55 GIT binary patch literal 2629 zcmV-L3cB?$f(k(b0Ru3C3I_%WDuzgg_YDCD0ic2j_ymFp^e}=6@Gyb|rv?cshDe6@ z4FLxRpn?RLFoFb>0s#Opf&`5Q2`Yw2hW8Bt2LUh~1_~;MNQU#UM0@h&@GnTGLl!>6jLEc62ry(~MrkHNL_D;~h9^+@FV_~p@0zS^R^2^&&Li?uk zFHLHvJk;m=VBe-`)nZ(aKmn#QkX`OFJck%;S9^=dutXMc1x15kAlHXX z75Et`G2Q%y4!D|MrVtQN*!zZiu_!1wjLqVqO={-kv#CT|2fPJU%+u*b{)dCTE+m}DD4;x-tVTPSXiWg1E75&Oh?`>3xtq+l!s z6Tnu6M!1)BZv3dQdm`!fQjxis$hVj7N%S`3vrKE%DouvE=MA0vA5}0YA(fe|C<78E z2vL3E2v~W|;^Y)9YH5q%Dp<_fOu3A$RUxJR4=9sDAuzvoZgwkKQVy~eO7C~pFo^-7 zGJ710-@M2~(9;&@R>G3cl(IYUx2X0}z_KHIemiB9(r;|r*ghSGWu=Ex47qRN&I(Gv z8>FdQdS(PGu}VOO))oRki(p(~Wq!fViH%bYL1*K9Ll26II-em7x`4OE>rM4SAWs!B zF(glb%mT%XG!6b?P1*kl0?KVyBvv@XdvF~nQrwacNpcN`&`rWmVo9RWgT7TKBLp~R zrZ8YJ=%6`@tQrx9KXV9I?_3_>l#ZpdkL~#QCr`zmzKqFo1}A5s^n)hKj4N!p{6BKt z@V+hKkc^G{x5h1_SnI~UJAROohD||fv!b15FXE&xzw&_->kF}8*UO~p;!Jccve=&y z3P}|Nqk>7MK8RNzfI%QDc!#f(_UO(7C$sgBB%PI^JX0Woj=IcZ zQXG~B@VzC92X=*eSA!WSMC54&T$(%+DR53)mP$~f;X5pWcoFA6l@EDc!Z?UMYO>{~-@{1Iy<%-xEG@gS;Bz2XHZ;O@jF4*fa~HCk#m z&bo_4{OGT^1lUGS+{V=H-@~91%%v(rM$iggJIi2SrG~de4$5L;1-*qD)=bADUKjCz zcF`z|Dq&DqZZdk4yE$;->+BUX)8jx`&+dy@1Wqf5f6aRX`B zAd-uys32^m>1#Rc{gSTet3siozpBfIWSJWx#N#y-`j<4@ZN9m0vuW!;_}KPmAB~4W z^mGwki*CG3^c&LNQUn53@0_Usd@% zB^@$#*05BQthWJtd3+$&kcq&>I?$_Ifn`C*i&fb`@3*Ho_l5(g4TM5aQyk0B7vn>| zpA`=s+p;csJ+H?i?f~u8{R1c;gf6Pt1~$+BltbOu4`Ky7zEjcBdo=%a0|j1S{eft9?6T2 za8>aeqBAqFG@l&6auPRCAYhCp^-t{YCUFp;$2;qc;Q$`g3CSquvAeCu^|A`q-w0 zqs42vQlBh%V8VrZtN#LATfTkT7l+xF-qcC@8TTCJu{hkiAd$5G;725DR9n2CjA?7k+ais^oWfxur6d zUNH71HsK=FLP84haW{uR#I~-s=I(7VLoV*}IcQ&VDEIWl4sX(-tJ@uql)#d&W7iS?eUX1wOl>;S+gw2 z<=SM9Qo?U}_J7V_6QCh}eu#VG-?bVh0h$0raW?C{y9vyeXXn!2NOtu|$eC#I-H8-z zg?l8GDWXL8TjfX)-k0D`req$2{_=~`@psb$-E@{!-DOu&kt!^vN>Mb0Bf0o-WyldB zjJ0amNnRZZV=>x=G{psky4j%GATv6Zf?yl!rILJHW7^6erJZY5&lfn?t`aqHIPLuHAh<$l^;P z=_eZ|0fDY8Gj~v={hS9OnHPlWCj$)CPwxl0u=JCpkJn2O`h`gpRFTUGZU5T#XaF%K zFe3&DDuzgg_YDCF6)_eB6qypy;cDl?lT>J=+00?-+uKHXwlFa;AutIB1uG5%0vZJX n1QY^J4$o(k6*0Zo6)B2sX`qa`M7RV9;1@|C%69|&0s;sC&R^EN literal 0 HcmV?d00001 diff --git a/test/dotnetframework/SecurityAPITest/dummycerts/Test_sha1_1024_DER/dummy.txt b/test/dotnetframework/SecurityAPITest/dummycerts/Test_sha1_1024_DER/dummy.txt new file mode 100644 index 0000000..e69de29 From 0daced46514d9f6d9b4155947a916865e6d201a6 Mon Sep 17 00:00:00 2001 From: Claudia Murialdo Date: Tue, 8 Jun 2021 13:20:41 -0300 Subject: [PATCH 2/5] Remove build warnings Ignore Debug and bin folders --- .gitignore | 41 ++++--------------- .../GeneXusFtps/GeneXusFtps/FtpsClient.cs | 2 +- .../Commons/SecurityAPIObject.cs | 2 - .../SecurityAPITestNetCore.csproj | 5 ++- .../XmlSignature/DSig/TestRSASigning.cs | 7 +++- .../DSig/TestXmlSignatureDomainSpaces.cs | 10 ++--- 6 files changed, 23 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 09faa07..a03b360 100644 --- a/.gitignore +++ b/.gitignore @@ -25,37 +25,8 @@ dotnet/dotnetcore/GeneXusJWTNetCore/obj/ dotnet/dotnetcore/GeneXusJWTNetCore/bin/ dotnet/dotnetcore/GeneXusCryptographyNetCore/obj/ dotnet/dotnetcore/GeneXusCryptographyNetCore/bin/ -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.cache -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.dgspec.json -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.g.props -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/GeneXusFtpsNetCore.csproj.nuget.g.targets -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/project.assets.json -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfo.cs -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfoInputs.cache -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.assets.cache -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.csproj.CopyComplete -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.csproj.FileListAbsolute.txt -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCore.csprojAssemblyReference.cache -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfo.cs -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.AssemblyInfoInputs.cache -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.assets.cache -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.csproj.CopyComplete -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.csproj.FileListAbsolute.txt -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCore.csprojAssemblyReference.cache -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll -dotnet/dotnetcore/GeneXusFtpsNetCore/obj/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.deps.json -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.dll -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Debug/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.pdb -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.deps.json -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.dll -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusFtpsNetCoreImpl.pdb -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.dll -dotnet/dotnetcore/GeneXusFtpsNetCore/bin/Release/netcoreapp3.1/GeneXusSecurityAPICommonsNetCoreImpl.pdb +dotnet/dotnetcore/GeneXusFtpsNetCore/obj/ +dotnet/dotnetcore/GeneXusFtpsNetCore/bin/ dotnet/dotnetframework/GeneXusFtps/obj/ dotnet/dotnetframework/GeneXusFtps/bin/ dotnet/dotnetframework/GeneXusFtps/packages.config @@ -64,7 +35,9 @@ dotnet/resources/key.snk dotnet/dotnetcore/GeneXusFtpsNetCore/bin/ /test/dotnetcore/SecurityAPITestNetCore/.runsettings /test/dotnetframework/SecurityAPITest/.runsettings -/test/dotnetframework/SecurityAPITest/obj/Debug/net471/SecurityAPITest.AssemblyInfoInputs.cache -/test/dotnetframework/SecurityAPITest/obj/Debug/net471/SecurityAPITest.GeneratedMSBuildEditorConfig.editorconfig -/test/dotnetframework/SecurityAPITest/obj/Debug/net471/SecurityAPITest.csprojAssemblyReference.cache +/test/dotnetframework/SecurityAPITest/obj/ +/test/dotnetframework/SecurityAPITest/bin/ +/test/dotnetcore/SecurityAPITestNetCore/bin/ +/test/dotnetcore/SecurityAPITestNetCore/obj/ /test/resources/key.snk +/test/.runsettings diff --git a/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps/FtpsClient.cs b/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps/FtpsClient.cs index a6d91a7..5ea7608 100644 --- a/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps/FtpsClient.cs +++ b/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps/FtpsClient.cs @@ -235,7 +235,7 @@ public override string GetWorkingDirectory() { pwd = this.client.GetWorkingDirectory(); } - catch (IOException e) + catch (IOException) { this.error.setError("FS006", "Could not obtain working directory, try reconnect"); return ""; diff --git a/dotnet/dotnetframework/SecurityAPICommons/Commons/SecurityAPIObject.cs b/dotnet/dotnetframework/SecurityAPICommons/Commons/SecurityAPIObject.cs index 033aa80..093a50b 100644 --- a/dotnet/dotnetframework/SecurityAPICommons/Commons/SecurityAPIObject.cs +++ b/dotnet/dotnetframework/SecurityAPICommons/Commons/SecurityAPIObject.cs @@ -13,8 +13,6 @@ namespace SecurityAPICommons.Commons [SecuritySafeCritical] public class SecurityAPIObject { - [SecuritySafeCritical] - private Error _error; [SecuritySafeCritical] public Error error; diff --git a/test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj b/test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj index 9bf1b50..a088b69 100644 --- a/test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj +++ b/test/dotnetcore/SecurityAPITestNetCore/SecurityAPITestNetCore.csproj @@ -86,7 +86,6 @@ - @@ -719,6 +718,10 @@ PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs index 9a7e531..5cb6f19 100644 --- a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs +++ b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestRSASigning.cs @@ -37,9 +37,11 @@ public class TestRSASigning: SecurityAPITestObject private static Error error; +#if !NETCORE private static string xmlUnsignedXPathFile; private static string xPath; private static string xmlUnsignedXPath; +#endif private static string xmlUnsignedIDPathFile; private static string identifierAttribute; @@ -78,8 +80,10 @@ public virtual void SetUp() optionsXPath = new DSigOptions(); error = new Error(); +#if !NETCORE xmlUnsignedXPathFile = Path.Combine(BASE_PATH, "Temp", "bookSample.xml"); xPath = "/bookstore/book[1]"; +#endif xmlUnsignedIDPathFile = Path.Combine(BASE_PATH, "Temp", "xmlID.xml"); identifierAttribute = "id"; @@ -94,7 +98,7 @@ public virtual void SetUp() + " Don't forget me this weekend!\r\n" + " \r\n" + " \r\n" + " Jani\r\n" + " Tove\r\n" + " Re: Reminder\r\n" + " I will not\r\n" + " \r\n" + ""; - +#if !NETCORE xmlUnsignedXPath = "\r\n" + "\r\n" + "\r\n" + " Everyday Italian\r\n" + " Giada De Laurentiis\r\n" + " 2005\r\n" @@ -108,6 +112,7 @@ public virtual void SetUp() + " 49.99\r\n" + "\r\n" + "\r\n" + " Learning XML\r\n" + " Erik T. Ray\r\n" + " 2003\r\n" + " 39.95\r\n" + "\r\n" + ""; +#endif } [Test] diff --git a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs index 0be32f2..a39d846 100644 --- a/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs +++ b/test/dotnetframework/SecurityAPITest/XmlSignature/DSig/TestXmlSignatureDomainSpaces.cs @@ -11,8 +11,8 @@ namespace SecurityAPITest.XmlSignature.DSig public class TestXmlSignatureDomainSpaces : SecurityAPITestObject { private static string path_RSA_sha1_1024; - private static string xmlUnsigned; - private static string dSigType; + //private static string xmlUnsigned; + //private static string dSigType; private static DSigOptions options; private static string pathKey; private static string pathCert; @@ -25,9 +25,9 @@ public virtual void SetUp() { signer = new XmlDSigSigner(); path_RSA_sha1_1024 = Path.Combine(BASE_PATH, "dummycerts", "RSA_sha1_1024"); - xmlUnsigned = "" + "" - + " " + " Ola mundo" + " " + ""; - dSigType = "ENVELOPED "; + //xmlUnsigned = "" + "" + // + " " + " Ola mundo" + " " + ""; + //dSigType = "ENVELOPED "; options = new DSigOptions(); pathKey = Path.Combine(path_RSA_sha1_1024, "sha1d_key.pem"); From 6c2e41b51a6e4df3f5b195e0cb05454c33c6d531 Mon Sep 17 00:00:00 2001 From: Claudia Murialdo Date: Thu, 10 Jun 2021 14:36:39 -0300 Subject: [PATCH 3/5] Remove compiler warnings. Set key.snk at Directory.Build.props. --- SecurityAPIParent.sln | 1 - dotnet/dotnetframework/Directory.Build.props | 7 +++++++ .../GeneXusCryptography/GeneXusCryptography.csproj | 9 --------- dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj | 9 --------- .../GeneXusJWT/Commons/DateUtilObject.cs | 3 +++ .../dotnetframework/GeneXusJWT/Commons/GUIDObject.cs | 2 ++ dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj | 6 ------ dotnet/dotnetframework/GeneXusJWT/JWTClaims/Claims.cs | 4 ++-- .../GeneXusJWT/JWTClaims/PrivateClaims.cs | 2 -- .../GeneXusJWT/JWTClaims/RegisteredClaims.cs | 9 ++++----- dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj | 8 -------- .../GeneXusXmlSignature/GeneXusXmlSignature.csproj | 11 +---------- .../SecurityAPICommons/SecurityAPICommons.csproj | 8 -------- test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs | 6 +++--- 14 files changed, 22 insertions(+), 63 deletions(-) diff --git a/SecurityAPIParent.sln b/SecurityAPIParent.sln index 398608c..a75bb54 100644 --- a/SecurityAPIParent.sln +++ b/SecurityAPIParent.sln @@ -43,7 +43,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityAPITest", "test\dot EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{88EB1BC4-0D68-4906-AA36-E1EA1F6AFD35}" ProjectSection(SolutionItems) = preProject - dotnet\resources\key.snk = dotnet\resources\key.snk dotnet\resources\Neon.SSH.NET.dll = dotnet\resources\Neon.SSH.NET.dll EndProjectSection EndProject diff --git a/dotnet/dotnetframework/Directory.Build.props b/dotnet/dotnetframework/Directory.Build.props index 4085f74..146c3cf 100644 --- a/dotnet/dotnetframework/Directory.Build.props +++ b/dotnet/dotnetframework/Directory.Build.props @@ -4,5 +4,12 @@ 17.4.0 $([System.DateTime]::UtcNow.ToString("yyyy")) Copyright © 1988-$(CopyrightYear) GeneXus. All Rights Reserved + $(GENEXUS_SECURITY_MODULE_SNK_FILE) + true + GeneXus + true + true + 4 + NU5105;CS0618;CS8032 diff --git a/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj b/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj index 00f5d21..4ce9692 100644 --- a/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj +++ b/dotnet/dotnetframework/GeneXusCryptography/GeneXusCryptography.csproj @@ -3,8 +3,6 @@ net47 GeneXusCryptography GeneXusCryptographyImpl - true - ..\..\resources\key.snk @@ -12,11 +10,4 @@ - - - key.snk - - - - \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj b/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj index c1e91ba..0d0566c 100644 --- a/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj +++ b/dotnet/dotnetframework/GeneXusFtps/GeneXusFtps.csproj @@ -1,11 +1,8 @@  net47 - GeneXusFtps GeneXusFtpsImpl - true - ..\..\resources\key.snk @@ -13,10 +10,4 @@ - - - key.snk - - - \ No newline at end of file diff --git a/dotnet/dotnetframework/GeneXusJWT/Commons/DateUtilObject.cs b/dotnet/dotnetframework/GeneXusJWT/Commons/DateUtilObject.cs index 9e0c69a..c58715f 100644 --- a/dotnet/dotnetframework/GeneXusJWT/Commons/DateUtilObject.cs +++ b/dotnet/dotnetframework/GeneXusJWT/Commons/DateUtilObject.cs @@ -11,8 +11,11 @@ namespace GeneXusJWT.GenexusComons [SecuritySafeCritical] public abstract class DateUtilObject : SecurityAPIObject { + [Obsolete("DateUtil object is deprecated. Use GeneXus DateTime data type instead https://wiki.genexus.com/commwiki/servlet/wiki?7370,DateTime%20data%20type")] public abstract string GetCurrentDate(); + [Obsolete("DateUtil object is deprecated. Use GeneXus DateTime data type instead https://wiki.genexus.com/commwiki/servlet/wiki?7370,DateTime%20data%20type")] public abstract string CurrentPlusSeconds(long seconds); + [Obsolete("DateUtil object is deprecated. Use GeneXus DateTime data type instead https://wiki.genexus.com/commwiki/servlet/wiki?7370,DateTime%20data%20type")] public abstract string CurrentMinusSeconds(long seconds); } } diff --git a/dotnet/dotnetframework/GeneXusJWT/Commons/GUIDObject.cs b/dotnet/dotnetframework/GeneXusJWT/Commons/GUIDObject.cs index 8cc3c5b..7357085 100644 --- a/dotnet/dotnetframework/GeneXusJWT/Commons/GUIDObject.cs +++ b/dotnet/dotnetframework/GeneXusJWT/Commons/GUIDObject.cs @@ -1,5 +1,6 @@  using SecurityAPICommons.Commons; +using System; using System.Security; namespace GeneXusJWT.GenexusComons @@ -8,6 +9,7 @@ namespace GeneXusJWT.GenexusComons public abstract class GUIDObject : SecurityAPIObject { + [Obsolete("GUID object is deprecated. USe Genexus GUID data type instead https://wiki.genexus.com/commwiki/servlet/wiki?31772,GUID+data+type")] public abstract string Generate(); } } diff --git a/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj b/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj index 2f9e053..bc74cb7 100644 --- a/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj +++ b/dotnet/dotnetframework/GeneXusJWT/GeneXusJWT.csproj @@ -1,19 +1,13 @@  net47 - GeneXusJWT GeneXusJWTImpl - true - ..\..\resources\key.snk App.$(Configuration).config - - key.snk - diff --git a/dotnet/dotnetframework/GeneXusJWT/JWTClaims/Claims.cs b/dotnet/dotnetframework/GeneXusJWT/JWTClaims/Claims.cs index e8122d8..af59acf 100644 --- a/dotnet/dotnetframework/GeneXusJWT/JWTClaims/Claims.cs +++ b/dotnet/dotnetframework/GeneXusJWT/JWTClaims/Claims.cs @@ -10,7 +10,7 @@ namespace GeneXusJWT.GenexusJWTClaims public class Claims { - private List _claims; + protected List _claims; [SecuritySafeCritical] public Claims() @@ -33,7 +33,7 @@ public List getAllClaims() } [SecuritySafeCritical] - public object getClaimValue(string key, Error error) + public virtual object getClaimValue(string key, Error error) { for (int i = 0; i < _claims.Count; i++) { diff --git a/dotnet/dotnetframework/GeneXusJWT/JWTClaims/PrivateClaims.cs b/dotnet/dotnetframework/GeneXusJWT/JWTClaims/PrivateClaims.cs index ffad850..5421953 100644 --- a/dotnet/dotnetframework/GeneXusJWT/JWTClaims/PrivateClaims.cs +++ b/dotnet/dotnetframework/GeneXusJWT/JWTClaims/PrivateClaims.cs @@ -7,8 +7,6 @@ namespace GeneXusJWT.GenexusJWTClaims [SecuritySafeCritical] public class PrivateClaims : Claims { - private List _claims; - [SecuritySafeCritical] public bool setClaim(string key, string value) { diff --git a/dotnet/dotnetframework/GeneXusJWT/JWTClaims/RegisteredClaims.cs b/dotnet/dotnetframework/GeneXusJWT/JWTClaims/RegisteredClaims.cs index 1180854..dad9005 100644 --- a/dotnet/dotnetframework/GeneXusJWT/JWTClaims/RegisteredClaims.cs +++ b/dotnet/dotnetframework/GeneXusJWT/JWTClaims/RegisteredClaims.cs @@ -10,7 +10,6 @@ namespace GeneXusJWT.GenexusJWTClaims [SecuritySafeCritical] public class RegisteredClaims : Claims { - private List claims; private IDictionary customTimeValidationClaims; public RegisteredClaims() @@ -88,15 +87,15 @@ public bool hasCustomValidationClaims() } - public object getClaimValue(string key, Error error) + public override object getClaimValue(string key, Error error) { if (RegisteredClaimUtils.exists(key)) { - for (int i = 0; i < claims.Count; i++) + for (int i = 0; i < _claims.Count; i++) { - if (SecurityUtils.compareStrings(key, claims[i].getKey())) + if (SecurityUtils.compareStrings(key, _claims[i].getKey())) { - return claims[i].getValue(); + return _claims[i].getValue(); } } error.setError("RC001", "Could not find a claim with" + key + " key value"); diff --git a/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj b/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj index ea9d0ee..72e67d6 100644 --- a/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj +++ b/dotnet/dotnetframework/GeneXusSftp/GeneXusSftp.csproj @@ -1,22 +1,14 @@  net47 - GeneXusSftp GeneXusSftpClientImpl - true - ..\..\resources\key.snk ..\..\resources\Neon.SSH.NET.dll - - - key.snk - - diff --git a/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj b/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj index fd2df2f..5fa3488 100644 --- a/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj +++ b/dotnet/dotnetframework/GeneXusXmlSignature/GeneXusXmlSignature.csproj @@ -1,18 +1,9 @@  net47 - - GeneXusXmlSignature + GeneXusXmlSignature GeneXusXmlSignatureImpl - true - ..\..\resources\key.snk - - - key.snk - - - diff --git a/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj b/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj index 8d9d87a..66f667a 100644 --- a/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj +++ b/dotnet/dotnetframework/SecurityAPICommons/SecurityAPICommons.csproj @@ -2,9 +2,6 @@ net47 GeneXusSecurityAPICommonsImpl - 17.4.0 - true - ..\..\resources\key.snk @@ -13,9 +10,4 @@ - - - key.snk - - \ No newline at end of file diff --git a/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs b/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs index 18d7a8f..e8c1bae 100644 --- a/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs +++ b/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs @@ -25,15 +25,15 @@ public class TestSftp: SecurityAPITestObject public virtual void SetUp() { host = TestContextParameter("gx_ftp_host"); - user = TestContextParameter("gx_ftp_user"); + user = TestContextParameter("gx_sftp_user"); string known_hosts_content_base64 = TestContextParameter("gx_ftp_known_hosts_content_base64"); known_hosts = Path.Combine(BASE_PATH, "Temp", "sftptest", "key", "known_hosts"); File.WriteAllBytes(known_hosts, Convert.FromBase64String(known_hosts_content_base64)); - password = TestContextParameter("gx_ftp_password"); + password = TestContextParameter("gx_sftp_password"); keyPath = Path.Combine(BASE_PATH, "Temp", "sftptest", "key", "id_rsa"); string id_rsaConentBase64 = TestContextParameter("gx_ftp_id_rsa_content_base64"); File.WriteAllBytes(keyPath, Convert.FromBase64String(id_rsaConentBase64)); - keyPassword = TestContextParameter("gx_ftp_password"); + keyPassword = TestContextParameter("gx_sftp_key_password"); localPath = Path.Combine(BASE_PATH, "Temp", "sftptest", "sftptest1.txt"); remoteDir = "sftp"; remoteFilePath = "sftp/sftptest1.txt"; From 84dd4077e1759a27437a7f70d48c64a26123df84 Mon Sep 17 00:00:00 2001 From: Claudia Murialdo Date: Thu, 10 Jun 2021 14:46:55 -0300 Subject: [PATCH 4/5] Disable FTP tests when a .runsettings file is not configured. --- .../SecurityAPITest/Ftps/TestFtps.cs | 3 ++- .../SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs | 1 + .../commons/SecurityAPITestObject.cs | 15 ++++++++++++++- .../SecurityAPITest/Sftp/TestSftp.cs | 3 ++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs b/test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs index e987b7a..c452e24 100644 --- a/test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs +++ b/test/dotnetframework/SecurityAPITest/Ftps/TestFtps.cs @@ -7,7 +7,8 @@ namespace SecurityAPITest.Ftps { [TestFixture] - public class TestFtps: SecurityAPITestObject + [RunIfRunSettingsConfigured] + public class TestFtps: SecurityAPITestObject { protected static string host; protected static string user; diff --git a/test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs b/test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs index 518db19..a4ac3c1 100644 --- a/test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs +++ b/test/dotnetframework/SecurityAPITest/Ftps/TestFtpsDomainSpaces.cs @@ -6,6 +6,7 @@ namespace SecurityAPITest.Ftps { [TestFixture] + [RunIfRunSettingsConfigured] public class TestFtpsDomainSpaces : SecurityAPITestObject { protected static string host; diff --git a/test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs index c47a195..13a9395 100644 --- a/test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs +++ b/test/dotnetframework/SecurityAPITest/SecurityAPICommons/commons/SecurityAPITestObject.cs @@ -1,4 +1,5 @@ using NUnit.Framework; +using NUnit.Framework.Interfaces; using SecurityAPICommons.Commons; using SecurityAPICommons.Utils; using System; @@ -7,7 +8,19 @@ namespace SecurityAPITest.SecurityAPICommons.commons { - public class SecurityAPITestObject + public class RunIfRunSettingsConfigured : Attribute, ITestAction + { + public ActionTargets Targets { get; private set; } + + public void AfterTest(ITest test) { } + + public void BeforeTest(ITest test) + { + if (TestContext.Parameters.Count==0) + Assert.Ignore("Omitting {0}. RunSettings not configured for this solution.", test.Name); + } + } + public class SecurityAPITestObject { public string TestContextParameter(string key) { return TestContext.Parameters[key]; diff --git a/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs b/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs index e8c1bae..c0604bf 100644 --- a/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs +++ b/test/dotnetframework/SecurityAPITest/Sftp/TestSftp.cs @@ -7,7 +7,8 @@ namespace SecurityAPITest.Sftp { [TestFixture] - public class TestSftp: SecurityAPITestObject + [RunIfRunSettingsConfigured] + public class TestSftp: SecurityAPITestObject { protected static string host; protected static string user; From 06e8d3d73cfcb60aa9d11234836b0725f9abca87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Echag=C3=BCe?= Date: Tue, 8 Jun 2021 13:53:45 -0300 Subject: [PATCH 5/5] Setup FTP Server in WSL (Ubuntu) (cherry picked from commit daa962d4f124cabf03f44708a2591010e27f28b4) --- .github/workflows/test.yml | 124 +++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d6d8997 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,124 @@ +name: .NET + +on: + workflow_dispatch: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: windows-latest + env: + LINUX_DISTO: Ubuntu-20.04 + FTP_USER: fullgx + FTP_PASS: fullgx + TRUST_STORE_PASS: fullgx + + steps: + - uses: Vampire/setup-wsl@v1 + with: + distribution: ${{env.LINUX_DISTO}} + additional-packages: + vsftpd + + - name: Setup user + shell: wsl-bash {0} + run: | + sudo useradd -m -p $(perl -e 'print crypt($ARGV[0], "password")' '${{env.FTP_PASS}}') ${{env.FTP_USER}} + echo ${{env.FTP_USER}} >> /etc/vsftpd.userlist + + - name: Setup SSH + shell: wsl-bash {0} + run: | + sudo apt-get -qq -y purge openssh-server + sudo apt-get -qq -y install openssh-server + echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config + sudo service ssh --full-restart + + - uses: Vampire/setup-wsl@v1 + with: + distribution: ${{env.LINUX_DISTO}} + wsl-shell-command: bash -c "sudo -u ${{env.FTP_USER}} bash --noprofile --norc -euo pipefail '{0}'" + + - name: Setup certificates + shell: wsl-bash {0} + run: | + ssh-keygen -b 2048 -t rsa -m pem -f ~/.ssh/id_rsa -q -N "" + ssh-keygen -f ~/.ssh/id_rsa -m pem -e > /tmp/id_rsa.pem + + cat ~/.ssh/id_rsa > /tmp/vsftpd1.pem + cat /tmp/id_rsa.pem >> /tmp/vsftpd1.pem + + openssl req -new -x509 -key ~/.ssh/id_rsa -days 365 -subj "/CN=GeneXus" -out /tmp/ftp.cer + openssl pkcs12 -export -in /tmp/ftp.cer -inkey ~/.ssh/id_rsa -out /tmp/ftp_cert.pfx -password pass:${{env.TRUST_STORE_PASS}} + + ssh-keyscan -H 127.0.0.1 >> /tmp/known_hosts + + echo '::set-output name=BASE_64_ID_RSA::$(cat ~/.ssh/id_rsa | base64)' + echo '::set-output name=BASE_64_PFX_CERT::$(cat /tmp/ftp_cert.pfx | base64)' + echo '::set-output name=BASE_64_KNOWN_HOSTS::$(cat /tmp/known_hosts | base64)' + + - uses: Vampire/setup-wsl@v1 + with: + distribution: ${{env.LINUX_DISTO}} + wsl-shell-command: bash -c "bash --noprofile --norc -euo pipefail '{0}'" + + - name: Configure vsftpd + shell: wsl-bash {0} + run: | + mv /tmp/vsftpd1.pem /etc/ssl/private/vsftpd1.pem + mkdir -p /etc/vsftpd/ + + cat < /etc/vsftpd/vsftpd.conf + listen=NO + listen_ipv6=YES + anonymous_enable=NO + local_enable=YES + write_enable=YES + local_umask=022 + dirmessage_enable=YES + use_localtime=YES + xferlog_enable=YES + connect_from_port_20=YES + chroot_local_user=YES + secure_chroot_dir=/var/run/vsftpd/empty + pam_service_name=ftp + pasv_enable=Yes + pasv_min_port=10000 + pasv_max_port=11000 + user_sub_token=$USER + local_root=/home/$USER/ftp + userlist_enable=YES + userlist_file=/etc/vsftpd.userlist + userlist_deny=NO + rsa_cert_file=/etc/ssl/private/vsftpd1.pem + rsa_private_key_file=/etc/ssl/private/vsftpd1.pem + ssl_enable=YES + allow_anon_ssl=NO + force_local_data_ssl=YES + force_local_logins_ssl=YES + ssl_tlsv1=YES + ssl_sslv2=YES + ssl_sslv3=YES + require_ssl_reuse=NO + debug_ssl=YES + ssl_ciphers=HIGH + seccomp_sandbox=NO + isolate_network=NO + EOF + + sudo /etc/init.d/vsftpd start + + - uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore