Lines Matching refs:x
22 int X509_set_version(X509 *x, long version) in X509_set_version() argument
24 if (x == NULL) in X509_set_version()
26 if (version == X509_get_version(x)) in X509_set_version()
29 ASN1_INTEGER_free(x->cert_info.version); in X509_set_version()
30 x->cert_info.version = NULL; in X509_set_version()
31 x->cert_info.enc.modified = 1; in X509_set_version()
34 if (x->cert_info.version == NULL) { in X509_set_version()
35 if ((x->cert_info.version = ASN1_INTEGER_new()) == NULL) in X509_set_version()
38 if (!ASN1_INTEGER_set(x->cert_info.version, version)) in X509_set_version()
40 x->cert_info.enc.modified = 1; in X509_set_version()
44 int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) in X509_set_serialNumber() argument
48 if (x == NULL) in X509_set_serialNumber()
50 in = &x->cert_info.serialNumber; in X509_set_serialNumber()
53 x->cert_info.enc.modified = 1; in X509_set_serialNumber()
57 int X509_set_issuer_name(X509 *x, const X509_NAME *name) in X509_set_issuer_name() argument
59 if (x == NULL || !X509_NAME_set(&x->cert_info.issuer, name)) in X509_set_issuer_name()
61 x->cert_info.enc.modified = 1; in X509_set_issuer_name()
65 int X509_set_subject_name(X509 *x, const X509_NAME *name) in X509_set_subject_name() argument
67 if (x == NULL || !X509_NAME_set(&x->cert_info.subject, name)) in X509_set_subject_name()
69 x->cert_info.enc.modified = 1; in X509_set_subject_name()
89 int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm) in X509_set1_notBefore() argument
91 if (x == NULL || tm == NULL) in X509_set1_notBefore()
93 return ossl_x509_set1_time(&x->cert_info.enc.modified, in X509_set1_notBefore()
94 &x->cert_info.validity.notBefore, tm); in X509_set1_notBefore()
97 int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm) in X509_set1_notAfter() argument
99 if (x == NULL || tm == NULL) in X509_set1_notAfter()
101 return ossl_x509_set1_time(&x->cert_info.enc.modified, in X509_set1_notAfter()
102 &x->cert_info.validity.notAfter, tm); in X509_set1_notAfter()
105 int X509_set_pubkey(X509 *x, EVP_PKEY *pkey) in X509_set_pubkey() argument
107 if (x == NULL) in X509_set_pubkey()
109 if (!X509_PUBKEY_set(&(x->cert_info.key), pkey)) in X509_set_pubkey()
111 x->cert_info.enc.modified = 1; in X509_set_pubkey()
115 int X509_up_ref(X509 *x) in X509_up_ref() argument
119 if (CRYPTO_UP_REF(&x->references, &i) <= 0) in X509_up_ref()
122 REF_PRINT_COUNT("X509", x); in X509_up_ref()
127 long X509_get_version(const X509 *x) in X509_get_version() argument
129 return ASN1_INTEGER_get(x->cert_info.version); in X509_get_version()
132 const ASN1_TIME *X509_get0_notBefore(const X509 *x) in X509_get0_notBefore() argument
134 return x->cert_info.validity.notBefore; in X509_get0_notBefore()
137 const ASN1_TIME *X509_get0_notAfter(const X509 *x) in X509_get0_notAfter() argument
139 return x->cert_info.validity.notAfter; in X509_get0_notAfter()
142 ASN1_TIME *X509_getm_notBefore(const X509 *x) in X509_getm_notBefore() argument
144 return x->cert_info.validity.notBefore; in X509_getm_notBefore()
147 ASN1_TIME *X509_getm_notAfter(const X509 *x) in X509_getm_notAfter() argument
149 return x->cert_info.validity.notAfter; in X509_getm_notAfter()
152 int X509_get_signature_type(const X509 *x) in X509_get_signature_type() argument
154 return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg.algorithm)); in X509_get_signature_type()
157 X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x) in X509_get_X509_PUBKEY() argument
159 return x->cert_info.key; in X509_get_X509_PUBKEY()
162 const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x) in STACK_OF()
164 return x->cert_info.extensions; in STACK_OF()
167 void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid, in X509_get0_uids() argument
171 *piuid = x->cert_info.issuerUID; in X509_get0_uids()
173 *psuid = x->cert_info.subjectUID; in X509_get0_uids()
176 const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x) in X509_get0_tbs_sigalg() argument
178 return &x->cert_info.signature; in X509_get0_tbs_sigalg()
204 int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits, in X509_get_signature_info() argument
207 X509_check_purpose(x, -1, -1); in X509_get_signature_info()
208 return X509_SIG_INFO_get(&x->siginf, mdnid, pknid, secbits, flags); in X509_get_signature_info()
300 int ossl_x509_init_sig_info(X509 *x) in ossl_x509_init_sig_info() argument
302 return x509_sig_info_init(&x->siginf, &x->sig_alg, &x->signature, in ossl_x509_init_sig_info()
303 X509_PUBKEY_get0(x->cert_info.key)); in ossl_x509_init_sig_info()