ObjFW  Check-in [8f1fe21441]

Overview
Comment:OFX509Certificate*: Rename constructors
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tls-server
Files: files | file ages | folders
SHA3-256: 8f1fe2144142c0417b50d4e386583f56c8e41e121f0028d823bc9b00f128fb23
User & Date: js on 2024-11-18 20:58:24
Other Links: branch diff | manifest | tags
Context
2024-11-18
23:18
OFOpenSSLTLSStream: Add server support check-in: 7636fc0143 user: js tags: tls-server
20:58
OFX509Certificate*: Rename constructors check-in: 8f1fe21441 user: js tags: tls-server
00:47
Make GCC happy again check-in: f6cc2092af user: js tags: tls-server
Changes

Modified src/OFX509Certificate.h from [6f5ea71b48] to [431cc298b0].

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 */
@interface OFX509Certificate: OFObject
{
	OF_RESERVE_IVARS(OFX509Certificate, 4)
}

/**
 * @brief Returns a certificate chain from the specified IRI.
 *
 * @param IRI The IRI to retrieve the certificate chain from
 *
 * @throw OFOpenItemFailedException Opening the item failed
 * @throw OFUnsupportedProtocolException The specified IRI is not supported
 * @throw OFReadFailedException Reading the item failed
 * @throw OFInvalidFormatException The format of the item is invalid
 */
+ (OFArray OF_GENERIC(OFX509Certificate *) *)
    certificateChainFromIRI: (OFIRI *)IRI;
@end

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @brief The implementation for OFX509Certificate to use.







|

|
|






|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 */
@interface OFX509Certificate: OFObject
{
	OF_RESERVE_IVARS(OFX509Certificate, 4)
}

/**
 * @brief Returns the certificate chain from the PEM file at the specified IRI.
 *
 * @param IRI The IRI to the PEM file to retrieve the certificate chain from
 * @return An array of @ref OFX509Certificate
 * @throw OFOpenItemFailedException Opening the item failed
 * @throw OFUnsupportedProtocolException The specified IRI is not supported
 * @throw OFReadFailedException Reading the item failed
 * @throw OFInvalidFormatException The format of the item is invalid
 */
+ (OFArray OF_GENERIC(OFX509Certificate *) *)
    certificateChainFromPEMFileAtIRI: (OFIRI *)IRI;
@end

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @brief The implementation for OFX509Certificate to use.

Modified src/OFX509Certificate.m from [020fab5772] to [f350d9b960].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
								 object: self];
	}

	return [super alloc];
}

+ (OFArray OF_GENERIC(OFX509Certificate *) *)
    certificateChainFromIRI: (OFIRI *)IRI
{
	if (OFX509CertificateImplementation != Nil)
		return [OFX509CertificateImplementation
		    certificateChainFromIRI: IRI];

	OF_UNRECOGNIZED_SELECTOR
}
@end







|



|




36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
								 object: self];
	}

	return [super alloc];
}

+ (OFArray OF_GENERIC(OFX509Certificate *) *)
    certificateChainFromPEMFileAtIRI: (OFIRI *)IRI
{
	if (OFX509CertificateImplementation != Nil)
		return [OFX509CertificateImplementation
		    certificateChainFromPEMFileAtIRI: IRI];

	OF_UNRECOGNIZED_SELECTOR
}
@end

Modified src/OFX509CertificatePrivateKey.h from [c6b920cf5c] to [3afc4a8a34].

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 */
@interface OFX509CertificatePrivateKey: OFObject
{
	OF_RESERVE_IVARS(OFX509Certificate, 4)
}

/**
 * @brief Returns a private key from the specified IRI.
 *
 * @param IRI The IRI to retrieve the private key from
 *
 * @throw OFInitializationFailedException Initializing the private key failed
 * @throw OFOpenItemFailedException Opening the item failed
 * @throw OFUnsupportedProtocolException The specified IRI is not supported
 * @throw OFReadFailedException Reading the item failed
 * @throw OFInvalidFormatException The format of the item is invalid
 */
+ (instancetype)privateKeyFromIRI: (OFIRI *)IRI;
@end

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @brief The implementation for OFX509CertificatePrivateKey to use.







|









|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 */
@interface OFX509CertificatePrivateKey: OFObject
{
	OF_RESERVE_IVARS(OFX509Certificate, 4)
}

/**
 * @brief Returns the private key from the PEM file at the specified IRI.
 *
 * @param IRI The IRI to retrieve the private key from
 *
 * @throw OFInitializationFailedException Initializing the private key failed
 * @throw OFOpenItemFailedException Opening the item failed
 * @throw OFUnsupportedProtocolException The specified IRI is not supported
 * @throw OFReadFailedException Reading the item failed
 * @throw OFInvalidFormatException The format of the item is invalid
 */
+ (instancetype)privateKeyFromPEMFileAtIRI: (OFIRI *)IRI;
@end

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @brief The implementation for OFX509CertificatePrivateKey to use.

Modified src/OFX509CertificatePrivateKey.m from [89a24cbac0] to [628a650aef].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
		@throw [OFNotImplementedException exceptionWithSelector: _cmd
								 object: self];
	}

	return [super alloc];
}

+ (instancetype)privateKeyFromIRI: (OFIRI *)IRI
{
	if (OFX509CertificatePrivateKeyImplementation != Nil)
		return [OFX509CertificatePrivateKeyImplementation
		    privateKeyFromIRI: IRI];

	OF_UNRECOGNIZED_SELECTOR
}
@end







|



|




36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
		@throw [OFNotImplementedException exceptionWithSelector: _cmd
								 object: self];
	}

	return [super alloc];
}

+ (instancetype)privateKeyFromPEMFileAtIRI: (OFIRI *)IRI
{
	if (OFX509CertificatePrivateKeyImplementation != Nil)
		return [OFX509CertificatePrivateKeyImplementation
		    privateKeyFromPEMFileAtIRI: IRI];

	OF_UNRECOGNIZED_SELECTOR
}
@end

Modified src/tls/OFGnuTLSX509Certificate.m from [f1631a4c53] to [1050c14b20].

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
+ (void)load
{
	if (OFX509CertificateImplementation == Nil)
		OFX509CertificateImplementation = self;
}

+ (OFArray OF_GENERIC(OFX509Certificate *) *)
    certificateChainFromIRI: (OFIRI *)IRI
{
	OFMutableArray *chain = [OFMutableArray array];
	void *pool = objc_autoreleasePoolPush();
	OFData *data = [OFData dataWithContentsOfIRI: IRI];
	gnutls_datum_t datum;
	gnutls_x509_crt_t *certs;
	unsigned int i, size;







|







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
+ (void)load
{
	if (OFX509CertificateImplementation == Nil)
		OFX509CertificateImplementation = self;
}

+ (OFArray OF_GENERIC(OFX509Certificate *) *)
    certificateChainFromPEMFileAtIRI: (OFIRI *)IRI
{
	OFMutableArray *chain = [OFMutableArray array];
	void *pool = objc_autoreleasePoolPush();
	OFData *data = [OFData dataWithContentsOfIRI: IRI];
	gnutls_datum_t datum;
	gnutls_x509_crt_t *certs;
	unsigned int i, size;

Modified src/tls/OFGnuTLSX509CertificatePrivateKey.m from [06ae647eee] to [05a69fa4b6].

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

+ (void)load
{
	if (OFX509CertificatePrivateKeyImplementation == Nil)
		OFX509CertificatePrivateKeyImplementation = self;
}

+ (instancetype)privateKeyFromIRI: (OFIRI *)IRI
{
	void *pool = objc_autoreleasePoolPush();
	OFData *data = [OFData dataWithContentsOfIRI: IRI];
	gnutls_datum_t datum;
	gnutls_x509_privkey_t key;
	OFGnuTLSX509CertificatePrivateKey *privateKey;








|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

+ (void)load
{
	if (OFX509CertificatePrivateKeyImplementation == Nil)
		OFX509CertificatePrivateKeyImplementation = self;
}

+ (instancetype)privateKeyFromPEMFileAtIRI: (OFIRI *)IRI
{
	void *pool = objc_autoreleasePoolPush();
	OFData *data = [OFData dataWithContentsOfIRI: IRI];
	gnutls_datum_t datum;
	gnutls_x509_privkey_t key;
	OFGnuTLSX509CertificatePrivateKey *privateKey;