Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7646209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:08:57+00:00 2026-05-31T10:08:57+00:00

import std.stdio; import deimos.openssl.bn; import deimos.openssl.rsa; const KEY_SIZE = 1024; void main(string[] args) {

  • 0
import std.stdio;
import deimos.openssl.bn;
import deimos.openssl.rsa;

const KEY_SIZE = 1024;

void main(string[] args) {
    if (args.length < 1) {
        writeln("too few arguments");
    }

    RSA* rsa = RSA_new();
    rsa = RSA_generate_key(KEY_SIZE, RSA_F4, null, null);
    if(rsa==null) {
        writeln("failure");
    }
    else {
        writeln("success");

        // error generated by the line below
        if(!BN_generate_prime(rsa.p, (KEY_SIZE/2), 1, null, null, null, null)) {
            writeln("prime_failure");
        }
        else {
            writeln("prime success");
        }

        RSA_free(rsa);
    }   
}

This leads to the following error:

rsa.d(21): Error: struct rsa_st is forward referenced

The error occurs anytime I try to access an element in the rsa struct. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:08:58+00:00Added an answer on May 31, 2026 at 10:08 am

    I was able to get in contact with one of the people who frequently updates the OpenSSL Deimos on github and was able to get a response from him.

    Basically the OpenSSL C API forward-declares structs in some places where the exact definitions are not required and these have stuck around in some of the D modules.

    He requested a pull to the repository and the changes he made will fix your current problem. Here is the link:

    Deimos: openssl update

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello World for D looks like this: import std.stdio; void main(string[] args) { writeln(Hello
std.process has a nice shell() function. import std.process; import std.stdio; void main() { string
import std.stdio; void main(){ int n; while(readf("%d", &n)){ if(n == 11) break; writeln(n); }
import java.lang.Math; public class NewtonIteration { public static void main(String[] args) { System.out.print(rootNofX(2,9)); }
import std.stdio; struct S { string m_str = "defaultString"; this(this) { writeln("In this(this)"); }
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DateDemo { public static void main(String[]
import java.io.*; import java.util.Scanner; import java.util.StringTokenizer; public class Filereader { public static void main(String[]
Linking the following two files gives me a link-error: a.d: import std.stdio; extern string
I have the following code in D import std.stdio; class Thing { // Fields
Consider the following code: module ftwr; import std.regex; import std.stdio; import std.conv; import std.traits;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.