This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nonce записывается в расширениях запроса https://datatracker.ietf.org/doc/html/rfc6960#page-35 | |
| TBSRequest ::= SEQUENCE { | |
| version [0] EXPLICIT Version DEFAULT v1, | |
| requestorName [1] EXPLICIT GeneralName OPTIONAL, | |
| requestList SEQUENCE OF Request, | |
| requestExtensions [2] EXPLICIT Extensions {{re-ocsp-nonce | | |
| re-ocsp-response, ..., | |
| re-ocsp-preferred-signature-algorithms}} OPTIONAL } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.security.auth.x500.X500Principal; | |
| import kz.gov.pki.kalkan.asn1.ASN1Object; | |
| import kz.gov.pki.kalkan.asn1.ASN1Sequence; | |
| import kz.gov.pki.kalkan.asn1.ASN1Set; | |
| import kz.gov.pki.kalkan.asn1.DERObjectIdentifier; | |
| import kz.gov.pki.kalkan.asn1.DERString; | |
| import kz.gov.pki.kalkan.asn1.x509.X509Name; | |
| import kz.gov.pki.provider.utils.X509Util; | |
| public class PlusSignSubjectDN { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package kz.gov.pki.jwt; | |
| import java.security.KeyPair; | |
| import java.security.KeyPairGenerator; | |
| import java.security.Provider; | |
| import java.security.Security; | |
| import java.security.interfaces.ECPrivateKey; | |
| import java.security.interfaces.ECPublicKey; | |
| import com.auth0.jwt.JWT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package kz.sample.jwt; | |
| import java.io.ByteArrayInputStream; | |
| import java.security.Signature; | |
| import java.security.cert.CertificateFactory; | |
| import java.security.cert.X509Certificate; | |
| import java.util.Base64; | |
| import org.apache.commons.lang3.StringUtils; | |
| import lombok.extern.slf4j.Slf4j; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package kz.gov.egg.sync.client; | |
| import java.security.Security; | |
| import java.util.HashMap; | |
| import java.util.UUID; | |
| import org.apache.cxf.ext.logging.LoggingFeature; | |
| import org.apache.wss4j.common.crypto.WSProviderConfig; | |
| import kz.gov.egg.sync.client.gbd.fl.UniFlSyncClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package kz.gov.pki.sample; | |
| import java.io.StringWriter; | |
| import java.security.KeyStore; | |
| import java.security.Provider; | |
| import java.util.Enumeration; | |
| import kz.gov.pki.kalkan.Storage; | |
| import kz.gov.pki.kalkan.jce.provider.cms.CMSSignedData; | |
| import kz.gov.pki.kalkan.openssl.PEMWriter; | |
| import kz.gov.pki.provider.utils.CMSUtil; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.ByteArrayInputStream; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.io.StringWriter; | |
| import java.security.KeyStore; | |
| import java.security.PrivateKey; | |
| import java.security.Provider; | |
| import java.security.Security; | |
| import java.security.cert.X509Certificate; | |
| import java.util.Enumeration; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package kz.gov.pki.samples; | |
| import java.awt.Graphics; | |
| import java.awt.Image; | |
| import java.awt.Toolkit; | |
| import java.awt.datatransfer.DataFlavor; | |
| import java.awt.datatransfer.Transferable; | |
| import java.awt.datatransfer.UnsupportedFlavorException; | |
| import java.awt.image.BufferedImage; | |
| import java.io.ByteArrayInputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BIO *not_before_bio = BIO_new(BIO_s_mem()); | |
| ASN1_TIME_print(not_before_bio, X509_get_notBefore(cert)); // format MMM DD HH:MM:SS YYYY [GMT] | |
| // ASN1_STRING_print_ex(not_before_bio, X509_get_notAfter(cert), ASN1_STRFLGS_UTF8_CONVERT); // UTC format YYMMDDHHMMSSZ | |
| int not_before_len = BIO_number_written(not_before_bio); | |
| unsigned char *not_before = (unsigned char *)calloc(not_before_len, sizeof(unsigned char)); | |
| BIO_read(not_before_bio, not_before, not_before_len); | |
| NSLog(@"not before: %s", not_before); | |
| BIO_free(not_before_bio); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BIO *in = NULL, *out = NULL; | |
| CMS_ContentInfo *cms = NULL; | |
| CMS_SignerInfo *si = NULL; | |
| unsigned char *cms_pem = NULL; | |
| int cms_flags = CMS_NOSMIMECAP | CMS_BINARY | CMS_PARTIAL | CMS_STREAM; | |
| int cms_pem_len = 0; | |
| NSString *nsstring = @"c2FtcGxl"; | |
| const unsigned char *cstring = (const unsigned char *) [nsstring UTF8String]; |
NewerOlder