@Override public void encodeBitString(BigInteger integer) { ByteStringBuilder target = new ByteStringBuilder(); new DEREncoder(target).encodeInteger(integer); encodeBitString(target.toArray()); }
/** * Encode a {@code CertificationRequestInfo} using the given DER encoder. The ASN.1 definition of {@code CertificationRequestInfo} is: * * <pre> * CertificationRequestInfo ::= SEQUENCE { * version INTEGER { v1(0) } (v1,...), * subject Name, * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, * attributes [0] Attributes{{ CRIAttributes }} * } * </pre> * * @param encoder the DER encoder */ private void encodeCertificationRequestInfo(final DEREncoder encoder) { encoder.startSequence(); encoder.encodeInteger(VERSION); encoder.writeEncoded(subjectDn.getEncoded()); encoder.writeEncoded(publicKey.getEncoded()); // subjectPKInfo encoder.encodeImplicit(0); encodeAttributes(encoder); encoder.endSequence(); }
derEncoder.encodeInteger(version - 1); derEncoder.endExplicit(); derEncoder.encodeInteger(serialNumber);
final X509Certificate[] x509Certificates = credential.castAndApply(X509CertificateChainPublicCredential.class, X509CertificateChainPublicCredential::getCertificateChain); final DEREncoder encoder = new DEREncoder(); encoder.encodeInteger(x509Certificates.length); encoder.startSequence(); for (X509Certificate x509Certificate : x509Certificates) { encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.endSequence(); break; encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeIA5String(passwordSpec.getSeed()); encoder.encodeInteger(passwordSpec.getSequenceNumber()); encoder.endSequence(); break; encoder.startSequence(); encoder.encodeOctetString(new String(passwordSpec.getInitialKeyMaterial())); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeOctetString(passwordSpec.getMaskedPasswordBytes());
@Override public void encodeBitString(BigInteger integer) { ByteStringBuilder target = new ByteStringBuilder(); new DEREncoder(target).encodeInteger(integer); encodeBitString(target.toArray()); }
@Override public void encodeBitString(BigInteger integer) { ByteStringBuilder target = new ByteStringBuilder(); new DEREncoder(target).encodeInteger(integer); encodeBitString(target.toArray()); }
@Override public void encodeBitString(BigInteger integer) { ByteStringBuilder target = new ByteStringBuilder(); new DEREncoder(target).encodeInteger(integer); encodeBitString(target.toArray()); }
/** * Encode a {@code CertificationRequestInfo} using the given DER encoder. The ASN.1 definition of {@code CertificationRequestInfo} is: * * <pre> * CertificationRequestInfo ::= SEQUENCE { * version INTEGER { v1(0) } (v1,...), * subject Name, * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, * attributes [0] Attributes{{ CRIAttributes }} * } * </pre> * * @param encoder the DER encoder */ private void encodeCertificationRequestInfo(final DEREncoder encoder) { encoder.startSequence(); encoder.encodeInteger(VERSION); encoder.writeEncoded(subjectDn.getEncoded()); encoder.writeEncoded(publicKey.getEncoded()); // subjectPKInfo encoder.encodeImplicit(0); encodeAttributes(encoder); encoder.endSequence(); }
/** * Encode a {@code CertificationRequestInfo} using the given DER encoder. The ASN.1 definition of {@code CertificationRequestInfo} is: * * <pre> * CertificationRequestInfo ::= SEQUENCE { * version INTEGER { v1(0) } (v1,...), * subject Name, * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, * attributes [0] Attributes{{ CRIAttributes }} * } * </pre> * * @param encoder the DER encoder */ private void encodeCertificationRequestInfo(final DEREncoder encoder) { encoder.startSequence(); encoder.encodeInteger(VERSION); encoder.writeEncoded(subjectDn.getEncoded()); encoder.writeEncoded(publicKey.getEncoded()); // subjectPKInfo encoder.encodeImplicit(0); encodeAttributes(encoder); encoder.endSequence(); }
/** * Encode a {@code CertificationRequestInfo} using the given DER encoder. The ASN.1 definition of {@code CertificationRequestInfo} is: * * <pre> * CertificationRequestInfo ::= SEQUENCE { * version INTEGER { v1(0) } (v1,...), * subject Name, * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, * attributes [0] Attributes{{ CRIAttributes }} * } * </pre> * * @param encoder the DER encoder */ private void encodeCertificationRequestInfo(final DEREncoder encoder) { encoder.startSequence(); encoder.encodeInteger(VERSION); encoder.writeEncoded(subjectDn.getEncoded()); encoder.writeEncoded(publicKey.getEncoded()); // subjectPKInfo encoder.encodeImplicit(0); encodeAttributes(encoder); encoder.endSequence(); }
derEncoder.encodeInteger(version - 1); derEncoder.endExplicit(); derEncoder.encodeInteger(serialNumber);
derEncoder.encodeInteger(version - 1); derEncoder.endExplicit(); derEncoder.encodeInteger(serialNumber);
derEncoder.encodeInteger(version - 1); derEncoder.endExplicit(); derEncoder.encodeInteger(serialNumber);
final X509Certificate[] x509Certificates = credential.castAndApply(X509CertificateChainPublicCredential.class, X509CertificateChainPublicCredential::getCertificateChain); final DEREncoder encoder = new DEREncoder(); encoder.encodeInteger(x509Certificates.length); encoder.startSequence(); for (X509Certificate x509Certificate : x509Certificates) { encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.endSequence(); break; encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeIA5String(passwordSpec.getSeed()); encoder.encodeInteger(passwordSpec.getSequenceNumber()); encoder.endSequence(); break; encoder.startSequence(); encoder.encodeOctetString(new String(passwordSpec.getInitialKeyMaterial())); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeOctetString(passwordSpec.getMaskedPasswordBytes());
final X509Certificate[] x509Certificates = credential.castAndApply(X509CertificateChainPublicCredential.class, X509CertificateChainPublicCredential::getCertificateChain); final DEREncoder encoder = new DEREncoder(); encoder.encodeInteger(x509Certificates.length); encoder.startSequence(); for (X509Certificate x509Certificate : x509Certificates) { encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.endSequence(); break; encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeIA5String(passwordSpec.getSeed()); encoder.encodeInteger(passwordSpec.getSequenceNumber()); encoder.endSequence(); break; encoder.startSequence(); encoder.encodeOctetString(new String(passwordSpec.getInitialKeyMaterial())); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeOctetString(passwordSpec.getMaskedPasswordBytes());
final X509Certificate[] x509Certificates = credential.castAndApply(X509CertificateChainPublicCredential.class, X509CertificateChainPublicCredential::getCertificateChain); final DEREncoder encoder = new DEREncoder(); encoder.encodeInteger(x509Certificates.length); encoder.startSequence(); for (X509Certificate x509Certificate : x509Certificates) { encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.endSequence(); break; encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeIA5String(passwordSpec.getSeed()); encoder.encodeInteger(passwordSpec.getSequenceNumber()); encoder.endSequence(); break; encoder.startSequence(); encoder.encodeOctetString(new String(passwordSpec.getInitialKeyMaterial())); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeOctetString(passwordSpec.getMaskedPasswordBytes());