(RSAPublicKey key)
| 555 | } |
| 556 | |
| 557 | private static byte [] |
| 558 | fromRSAPublicKey(RSAPublicKey key) { |
| 559 | DNSOutput out = new DNSOutput(); |
| 560 | BigInteger exponent = key.getPublicExponent(); |
| 561 | BigInteger modulus = key.getModulus(); |
| 562 | int exponentLength = BigIntegerLength(exponent); |
| 563 | |
| 564 | if (exponentLength < 256) |
| 565 | out.writeU8(exponentLength); |
| 566 | else { |
| 567 | out.writeU8(0); |
| 568 | out.writeU16(exponentLength); |
| 569 | } |
| 570 | writeBigInteger(out, exponent); |
| 571 | writeBigInteger(out, modulus); |
| 572 | |
| 573 | return out.toByteArray(); |
| 574 | } |
| 575 | |
| 576 | private static byte [] |
| 577 | fromDSAPublicKey(DSAPublicKey key) { |
no test coverage detected