ParSet ::= SEQUENCE { T INTEGER h SEQUENCE OF INTEGER w SEQUENCE OF INTEGER K SEQUENCE OF INTEGER }
219220221222223224225226227
} public PrivateKey generatePrivate(PrivateKeyInfo keyInfo) throws IOException { RainbowPrivateKey pKey = RainbowPrivateKey.getInstance(keyInfo.parsePrivateKey()); return new BCRainbowPrivateKey(pKey.getInvA1(), pKey.getB1(), pKey.getInvA2(), pKey.getB2(), pKey.getVi(), pKey.getLayers()); }
209210211212213214215216217218219
return "Rainbow"; } public byte[] getEncoded() { RainbowPrivateKey privateKey = new RainbowPrivateKey(A1inv, b1, A2inv, b2, vi, layers); PrivateKeyInfo pki; try { AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PQCObjectIdentifiers.rainbow, DERNull.INSTANCE);
160161162163164165166167168169
return "X.509"; } public byte[] getEncoded() { RainbowPublicKey key = new RainbowPublicKey(docLength, coeffquadratic, coeffsingular, coeffscalar); AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PQCObjectIdentifiers.rainbow, DERNull.INSTANCE); return KeyUtil.getEncodedSubjectPublicKeyInfo(algorithmIdentifier, key); }
227228229230231232233234235
} public PublicKey generatePublic(SubjectPublicKeyInfo keyInfo) throws IOException { RainbowPublicKey pKey = RainbowPublicKey.getInstance(keyInfo.parsePublicKey()); return new BCRainbowPublicKey(pKey.getDocLength(), pKey.getCoeffQuadratic(), pKey.getCoeffSingular(), pKey.getCoeffScalar()); }