MCPcopy Index your code
hub / github.com/apache/tomcat / parsePKCS1

Method parsePKCS1

java/org/apache/tomcat/util/net/jsse/PEMFile.java:693–712  ·  view source on GitHub ↗
(byte[] source)

Source from the content-addressed store, hash-verified

691
692
693 private RSAPrivateCrtKeySpec parsePKCS1(byte[] source) {
694 Asn1Parser p = new Asn1Parser(source);
695
696 // https://en.wikipedia.org/wiki/X.690#BER_encoding
697 // https://tools.ietf.org/html/rfc8017#page-55
698
699 // Type (sequence)
700 p.parseTag(0x30);
701 // Length
702 p.parseFullLength();
703
704 BigInteger version = p.parseInt();
705 if (version.intValue() == 1) {
706 // JRE doesn't provide a suitable constructor for multi-prime
707 // keys
708 throw new IllegalArgumentException(sm.getString("pemFile.noMultiPrimes"));
709 }
710 return new RSAPrivateCrtKeySpec(p.parseInt(), p.parseInt(), p.parseInt(), p.parseInt(), p.parseInt(),
711 p.parseInt(), p.parseInt(), p.parseInt());
712 }
713
714
715 private byte[] fromHex(String hexString) {

Callers 1

toPrivateKeyMethod · 0.95

Implementers 1

ApplicationPartjava/org/apache/catalina/core/Applicat

Calls 4

parseTagMethod · 0.95
parseFullLengthMethod · 0.95
parseIntMethod · 0.95
getStringMethod · 0.65

Tested by

no test coverage detected