/** * Create an instance that will encode the given string as UTF-8. * * @param string the string to encode (must not be {@code null}) * @return the instance */ static ASN1Encodable ofUtf8String(String string) { Assert.checkNotNullParam("string", string); return e -> e.encodeUTF8String(string); }
/** * Construct a UserNotice policy qualifier. * * @param organizationText the organization text, or {@code null} to skip the NoticeReference section * @param noticeNumbers the notice numbers (only used if organization text is given) * @param explicitText explicit text for the notice, or {@code null} to skip the DisplayText section * @return the constructed policy qualifier */ public static PolicyQualifier userNoticeQualifier(String organizationText, BigInteger[] noticeNumbers, String explicitText) { return new PolicyQualifier(X500.OID_QT_UNOTICE, encoder -> { encoder.startSequence(); // userNotice if (organizationText != null) { encoder.startSequence(); // noticeRef encoder.encodeUTF8String(organizationText); encoder.startSequence(); // noticeNumbers if (noticeNumbers != null) for (BigInteger noticeNumber : noticeNumbers) { encoder.encodeInteger(noticeNumber); } encoder.endSequence(); // noticeNumbers encoder.endSequence(); // noticeRef } if (explicitText != null) { encoder.encodeUTF8String(explicitText); } encoder.endSequence(); // UserNotice }); }
/** * Create an instance that will encode the given string as UTF-8. * * @param string the string to encode (must not be {@code null}) * @return the instance */ static ASN1Encodable ofUtf8String(String string) { Assert.checkNotNullParam("string", string); return e -> e.encodeUTF8String(string); }
/** * Create an instance that will encode the given string as UTF-8. * * @param string the string to encode (must not be {@code null}) * @return the instance */ static ASN1Encodable ofUtf8String(String string) { Assert.checkNotNullParam("string", string); return e -> e.encodeUTF8String(string); }
/** * Create an instance that will encode the given string as UTF-8. * * @param string the string to encode (must not be {@code null}) * @return the instance */ static ASN1Encodable ofUtf8String(String string) { Assert.checkNotNullParam("string", string); return e -> e.encodeUTF8String(string); }
/** * Construct a UserNotice policy qualifier. * * @param organizationText the organization text, or {@code null} to skip the NoticeReference section * @param noticeNumbers the notice numbers (only used if organization text is given) * @param explicitText explicit text for the notice, or {@code null} to skip the DisplayText section * @return the constructed policy qualifier */ public static PolicyQualifier userNoticeQualifier(String organizationText, BigInteger[] noticeNumbers, String explicitText) { return new PolicyQualifier(X500.OID_QT_UNOTICE, encoder -> { encoder.startSequence(); // userNotice if (organizationText != null) { encoder.startSequence(); // noticeRef encoder.encodeUTF8String(organizationText); encoder.startSequence(); // noticeNumbers if (noticeNumbers != null) for (BigInteger noticeNumber : noticeNumbers) { encoder.encodeInteger(noticeNumber); } encoder.endSequence(); // noticeNumbers encoder.endSequence(); // noticeRef } if (explicitText != null) { encoder.encodeUTF8String(explicitText); } encoder.endSequence(); // UserNotice }); }
/** * Construct a UserNotice policy qualifier. * * @param organizationText the organization text, or {@code null} to skip the NoticeReference section * @param noticeNumbers the notice numbers (only used if organization text is given) * @param explicitText explicit text for the notice, or {@code null} to skip the DisplayText section * @return the constructed policy qualifier */ public static PolicyQualifier userNoticeQualifier(String organizationText, BigInteger[] noticeNumbers, String explicitText) { return new PolicyQualifier(X500.OID_QT_UNOTICE, encoder -> { encoder.startSequence(); // userNotice if (organizationText != null) { encoder.startSequence(); // noticeRef encoder.encodeUTF8String(organizationText); encoder.startSequence(); // noticeNumbers if (noticeNumbers != null) for (BigInteger noticeNumber : noticeNumbers) { encoder.encodeInteger(noticeNumber); } encoder.endSequence(); // noticeNumbers encoder.endSequence(); // noticeRef } if (explicitText != null) { encoder.encodeUTF8String(explicitText); } encoder.endSequence(); // UserNotice }); }
/** * Construct a UserNotice policy qualifier. * * @param organizationText the organization text, or {@code null} to skip the NoticeReference section * @param noticeNumbers the notice numbers (only used if organization text is given) * @param explicitText explicit text for the notice, or {@code null} to skip the DisplayText section * @return the constructed policy qualifier */ public static PolicyQualifier userNoticeQualifier(String organizationText, BigInteger[] noticeNumbers, String explicitText) { return new PolicyQualifier(X500.OID_QT_UNOTICE, encoder -> { encoder.startSequence(); // userNotice if (organizationText != null) { encoder.startSequence(); // noticeRef encoder.encodeUTF8String(organizationText); encoder.startSequence(); // noticeNumbers if (noticeNumbers != null) for (BigInteger noticeNumber : noticeNumbers) { encoder.encodeInteger(noticeNumber); } encoder.endSequence(); // noticeNumbers encoder.endSequence(); // noticeRef } if (explicitText != null) { encoder.encodeUTF8String(explicitText); } encoder.endSequence(); // UserNotice }); }