update tests
This commit is contained in:
		
							parent
							
								
									607e352b17
								
							
						
					
					
						commit
						4e16f360ed
					
				@ -1 +1 @@
 | 
			
		||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCba21UHE+VbDTpmYYFZUOV+OQ8AngOCdjROsPC0KiEfMvEaEM3NQl58u6QL7G7QsErKViiNPm9OTFo6HF5JijfWzK7haHFuRMEsgI4VwIYyhvqlJDfw/wt0AiVvSmoMfEQn1p1aiaO4V/RJSE3Vw/uz2bxiT22uSkSqOyShyfYE6dMHnuoBkzr4jvSifT+INmbv6Nyo4+AAMCZtYeHLrsFeSTjLL9jMPjI4ZkVdlw2n3Xn9NbltF3/8Ao8dQfElqw+LIQWqU0oFHYNIP4ttfl5ObMKHaKSvBMyNruZR0El/ZsrcHLkAHRCLj07KRQJ81l5CUTPtQ02P1Eamz/nT4I3
 | 
			
		||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCba21UHE+VbDTpmYYFZUOV+OQ8AngOCdjROsPC0KiEfMvEaEM3NQl58u6QL7G7QsErKViiNPm9OTFo6HF5JijfWzK7haHFuRMEsgI4VwIYyhvqlJDfw/wt0AiVvSmoMfEQn1p1aiaO4V/RJSE3Vw/uz2bxiT22uSkSqOyShyfYE6dMHnuoBkzr4jvSifT+INmbv6Nyo4+AAMCZtYeHLrsFeSTjLL9jMPjI4ZkVdlw2n3Xn9NbltF3/8Ao8dQfElqw+LIQWqU0oFHYNIP4ttfl5ObMKHaKSvBMyNruZR0El/ZsrcHLkAHRCLj07KRQJ81l5CUTPtQ02P1Eamz/nT4I3 rsa@localhost
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										72
									
								
								test.sh
									
									
									
									
									
								
							
							
						
						
									
										72
									
								
								test.sh
									
									
									
									
									
								
							@ -1,6 +1,70 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs1.pem
 | 
			
		||||
node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs8.pem
 | 
			
		||||
node bin/rasha.js ./fixtures/pub-rsa-2048.pkcs1.pem
 | 
			
		||||
node bin/rasha.js ./fixtures/pub-rsa-2048.spki.pem
 | 
			
		||||
echo ""
 | 
			
		||||
echo ""
 | 
			
		||||
echo "Testing PEM-to-JWK PKCS#1"
 | 
			
		||||
echo ""
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs1.pem > ./fixtures/privkey-rsa-2048.jwk.1.json
 | 
			
		||||
diff ./fixtures/privkey-rsa-2048.jwk.json ./fixtures/privkey-rsa-2048.jwk.1.json
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/pub-rsa-2048.pkcs1.pem > ./fixtures/pub-rsa-2048.jwk.1.json
 | 
			
		||||
diff ./fixtures/pub-rsa-2048.jwk.json ./fixtures/pub-rsa-2048.jwk.1.json
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
echo ""
 | 
			
		||||
echo ""
 | 
			
		||||
echo "Testing PEM-to-JWK PKCS#8"
 | 
			
		||||
echo ""
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/privkey-rsa-2048.pkcs8.pem > ./fixtures/privkey-rsa-2048.jwk.1.json
 | 
			
		||||
diff ./fixtures/privkey-rsa-2048.jwk.json ./fixtures/privkey-rsa-2048.jwk.1.json
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/pub-rsa-2048.spki.pem > ./fixtures/pub-rsa-2048.jwk.1.json
 | 
			
		||||
diff ./fixtures/pub-rsa-2048.jwk.json ./fixtures/pub-rsa-2048.jwk.1.json
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
echo ""
 | 
			
		||||
echo ""
 | 
			
		||||
echo "Testing JWK-to-PEM PKCS#1"
 | 
			
		||||
echo ""
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/privkey-rsa-2048.jwk.json pkcs1 > ./fixtures/privkey-rsa-2048.pkcs1.1.pem
 | 
			
		||||
diff ./fixtures/privkey-rsa-2048.pkcs1.pem ./fixtures/privkey-rsa-2048.pkcs1.1.pem
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/pub-rsa-2048.jwk.json pkcs1 > ./fixtures/pub-rsa-2048.pkcs1.1.pem
 | 
			
		||||
diff ./fixtures/pub-rsa-2048.pkcs1.pem ./fixtures/pub-rsa-2048.pkcs1.1.pem
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#echo ""
 | 
			
		||||
#echo ""
 | 
			
		||||
#echo "Testing JWK-to-PEM PKCS#8"
 | 
			
		||||
#echo ""
 | 
			
		||||
#
 | 
			
		||||
#node bin/rasha.js ./fixtures/privkey-rsa-2048.jwk.json pkcs8 > ./fixtures/privkey-rsa-2048.pkcs8.1.pem
 | 
			
		||||
#diff ./fixtures/privkey-rsa-2048.pkcs8.pem ./fixtures/privkey-rsa-2048.pkcs8.1.pem
 | 
			
		||||
#
 | 
			
		||||
#node bin/rasha.js ./fixtures/pub-rsa-2048.jwk.json spki > ./fixtures/pub-rsa-2048.spki.1.pem
 | 
			
		||||
#diff ./fixtures/pub-rsa-2048.pski.pem ./fixtures/pub-rsa-2048.spki.1.pem
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
echo ""
 | 
			
		||||
echo ""
 | 
			
		||||
echo "Testing JWK-to-SSH"
 | 
			
		||||
echo ""
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/privkey-rsa-2048.jwk.json ssh > ./fixtures/pub-rsa-2048.ssh.1.pub
 | 
			
		||||
diff ./fixtures/pub-rsa-2048.ssh.pub ./fixtures/pub-rsa-2048.ssh.1.pub
 | 
			
		||||
#
 | 
			
		||||
node bin/rasha.js ./fixtures/pub-rsa-2048.jwk.json ssh > ./fixtures/pub-rsa-2048.ssh.1.pub
 | 
			
		||||
diff ./fixtures/pub-rsa-2048.ssh.pub ./fixtures/pub-rsa-2048.ssh.1.pub
 | 
			
		||||
 | 
			
		||||
rm fixtures/*.1.*
 | 
			
		||||
 | 
			
		||||
echo ""
 | 
			
		||||
echo ""
 | 
			
		||||
echo "PASSED:"
 | 
			
		||||
echo "• All inputs produced valid outputs"
 | 
			
		||||
echo "• All outputs matched known-good values"
 | 
			
		||||
echo ""
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user